Loading TOC...

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 op.col function to get the value of a column.

Parameters
$value The expression providing the value to test.
$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.