Loading TOC...

MarkLogic Server 11.0 Product Documentation
op:eq

op:eq(
   $left as item()+,
   $right as item()
) as map:map

Summary

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:in((expr1, expr2, ..., exprN))

Parameters
$left The left value expression.
$right The right value expression.

Usage Notes

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.

Example

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() 
  

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