Loading TOC...

op.divide

op.divide(
   numericExpression as String,
   numericExpression as String
) as numericExpression

Summary

This function divides the left numericExpression by the right numericExpression and returns the value.

Parameters
numericExpression The left numeric expression.
numericExpression The right numeric expression.

Example

const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');

employees.select(["FirstName", "LastName", "Position", "EmployeeID",
                   op.as("divided", op.divide(op.col("EmployeeID"), 2))])
.result();
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.