
op:modulo( $left as item(), $right as item() ) as map:map
This function returns the remainder afer the division of the dividend and divisor expressions. For example, op:modulo(5, 2) returns 1.
| Parameters | |
|---|---|
| $left | The dividend numeric expression. |
| $right | The divisor numeric expression. |
xquery version "1.0-ml";
import module namespace op="http://marklogic.com/optic"
at "/MarkLogic/optic.xqy";
let $employees := op:from-view("main", "employees")
return $employees
=> op:select(("FirstName", "LastName", "Position", "EmployeeID",
op:as("modulo", op:modulo(op:col("EmployeeID"), 2))
))
=> op:result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.