fn.unordered( $sourceSeq as ValueIterator ) as ValueIterator
Returns the items of $sourceSeq in an implementation dependent order.
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.
|$sourceSeq||The sequence of items. If you pass in a single value, it is treated as a ValueIterator 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.|
fn.unordered(xdmp.arrayValues([1, 3, 2])); => 1, 3, 2