Loading TOC...

MarkLogic Server 11.0 Product Documentation
op.isDefined

op.isDefined(
   booleanExpression as xs.boolean
) as booleanExpression

Summary

This function tests whether the value of an expression is null in the row where the expression might be as simple as a column identified by op.col .

Parameters
booleanExpression A boolean expression that might be null. See Boolean Expression Functions for the list of functions used to build boolean expressions.

Example

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

op.fromLiterals([
	            {row:1, sparse:6},
	            {row:2},
	            {row:3, sparse:4}
	            ])
	          .select(['row', 'sparse',
	              op.as('defcheck', op.sem.if(op.isDefined(op.col('sparse')), 'present', 'absent'))
	              ])
	          .result();
  

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