MarkLogic 10 Product Documentation
fn.unordered

fn.unordered(
   sourceSeq as Sequence
) as Sequence

Summary

Returns the items of $sourceSeq in an implementation dependent order.

Note:

Query optimizers may be able to do a better job if the order of the output sequence is not specified. For example, when retrieving prices from a purchase order, if an index exists on prices, it may be more efficient to return the prices in index order rather than in document order.

Parameters
sourceSeq The sequence of items. If you pass in a single value, it is treated as a Sequence with that single item; therefore, if you pass in an array, the array is treated as a single value (not as one value for each item in the array). If you mean to pass in the values of each item in the array, then you can call xdmp.arrayValues on the array.

Example

fn.unordered(xdmp.arrayValues([1, 3, 2]));

=> 1, 3, 2
Powered by MarkLogic Server | Terms of Use | Privacy Policy