Loading TOC...

MarkLogic 9 Product Documentation
fn.head

fn.head(
   seq as Sequence
) as Item?

Summary

Returns the first item in a sequence. For more details, see XPath 3.0 Functions and Operators.

Parameters
seq A Sequence of items. A single item is treated as a Sequence of one. An Array is treated as a single item -- if an Array is passed in, the Array is returned. To make a Sequence from an Array see xdmp.arrayValues.

Example

fn.head(xdmp.arrayValues([1,2,3]))
=> 1

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