
op:eq( $left as item()+, $right as item() ) as map:map
This function takes two or more expressions and returns true
if all of the expressions return the same value.
Otherwise, it returns false.
The expressions can include calls to the
op:col function
to get the value of a column.
As a convenience, you can pass a sequence of any number of expressions as the
first argument: op:eq((expr1, expr2, ..., exprN))
| Parameters | |
|---|---|
| $left | The left value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. |
| $right | The right value expression. It can be a number, a column function such as op:col, op:view-col, or op:schema-col, or an expression. |
For convenience in the case of a simple comparison, the op:eq() operator can also take two expressions as separate arguments instead of a sequence of multiple expressions as a single argument.
xquery version "1.0-ml";
import module namespace op="http://marklogic.com/optic"
at "/MarkLogic/optic.xqy";
op:from-view("main", "employees")
=> op:where(op:eq(op:col("EmployeeID"), 3))
=> op:select(("EmployeeID", "FirstName", "LastName"))
=> op:order-by("EmployeeID")
=> op:result()
xquery version "1.0-ml";
import module namespace op="http://marklogic.com/optic"
at "/MarkLogic/optic.xqy";
let $eployeeId := 3
return op:from-view("main", "employees")
=> op:where(op:eq((op:col("EmployeeID"), 3, $employeeId)))
=> op:select(("EmployeeID", "FirstName", "LastName"))
=> op:order-by("EmployeeID")
=> op:result()
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.