Loading TOC...

MarkLogic 12 Product Documentation
op.or

op.or(
   left as booleanExpression,
   right as booleanExpression, ...
) as booleanExpression

Summary

This function returns true if any of the specified boolean expressions return true. Otherwise, it returns false.

As a convenience, the function allows passing any number of expression arguments in the form: op.or(expr1, expr2, ..., exprN)

Parameters
left The left value expression. See Boolean Expression Functions for the list of functions used to build boolean expressions.
right The right value expression.

Example

const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');

employees.where(
  op.or(
    op.gt(op.col('EmployeeID'), 3),
    op.eq(op.col('FirstName'), 'Steve')
  )
)
.result();

  

Example

const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');

employees.where(
  op.or(
    op.gt(op.col('EmployeeID'), 3),
    op.eq(op.col('FirstName'), 'Steve'),
    op.eq(op.col('LastName'), 'Martin')
  )
)
.result();
  

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