Loading TOC...

MarkLogic 12 Product Documentation
op:is-defined

op:is-defined(
   $operand as item()
) as map:map

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 column parameter function , such as op:col.

Parameters
$operand A boolean expression, such as op:eq or op:not, that might be null.

Example

xquery version "1.0-ml";

import module namespace op="http://marklogic.com/optic"
     at "/MarkLogic/optic.xqy";
     
op:from-literals((
    map:entry("row", 1) => map:with("sparse", 6),
    map:entry("row", 2),
    map:entry("row", 3) => map:with("sparse", 4)
    ))
        => op:where(op:is-defined(op:col('sparse')))
        => op:select(("row", "sparse"))
        => op:result()
 
  

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