Loading TOC...

MarkLogic 12 Product Documentation
op.in

op.in(
   value as expression,
   anyOf as expression[]
) as booleanExpression

Summary

This function returns true if a test expression evaluates to the same value as any of a list of candidate expressions. Otherwise, it returns false. The expressions can include calls to the column parameter function such as op.col function to get the value of a column.

Parameters
value The expression providing the value to test. It can be a number, a column function such as op.col, op.viewCol, or op.schemaCol, which contains numbers or an expression that outputs a number.
anyOf One or more expressions providing the candidate values.

Example

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

op.fromView('main', 'employees')
   .where(op.in(op.col('EmployeeID'), [3, 5, 8]))
   .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.