Loading TOC...

MarkLogic 12 Product Documentation
op.eq

op.eq(
   valueExpression as String
) as booleanExpression

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, the function allows passing any number of expression arguments in the form: op.eq(expr1, expr2, ..., exprN)

Parameters
valueExpression Two or more expressions, which can be a number, a column function such as op.col, op.viewCol, or op.schemaCol, or expression.

Example

const op = require('/MarkLogic/optic');

op.fromView('main', 'employees')
   .where(op.eq(op.col('EmployeeID'), 3))
   .select(['EmployeeID', 'FirstName', 'LastName'])
   .orderBy('EmployeeID')
   .result();
  

Example

const op = require('/MarkLogic/optic');
const employeeId = 3;
op.fromView('main', 'employees')
   .where(op.eq(op.col('EmployeeID'), 3, employeeId))
   .select(['EmployeeID', 'FirstName', 'LastName'])
   .orderBy('EmployeeID')
   .result();
  

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