op.modulo( numericExpression as String, numericExpression as String ) as numericExpression
This function returns the remainder afer the division of the dividend and divisor expressions. For example, op:modulo(5, 2) returns 1.
Parameters | |
---|---|
numericExpression | The dividend numeric expression. |
numericExpression | The divisor numeric expression. |
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)), op.as("modulo", op.modulo(op.col("EmployeeID"), 2))]) .result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.