MarkLogic Server 11.0 Product Documentation
fn:filter

fn:filter(
   $function as function(item()) as xs:boolean,
   $seq as item()*
) as item()*

Summary

Returns those items from the sequence $seq for which the supplied function $function returns true. For more details, see XPath 3.0 Functions and Operators.

Parameters
function The function value.
seq The function value.

Example

fn:filter(function($a) { $a mod 2 = 0 }, (1 to 10))
=> (2, 4, 6, 8, 10)
Powered by MarkLogic Server | Terms of Use | Privacy Policy