<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.unordered.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.unordered</api:function-name><api:suggest>fn.unordered</api:suggest><api:suggest>fn</api:suggest><api:suggest>unordered</api:suggest><api:function-link mode="xquery" fullname="fn:unordered">/apidoc/8.0/fn:unordered.xml</api:function-link><api:function mode="javascript" name="unordered" type="builtin" lib="fn" category="SequenceBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.unordered"><api:summary>
<p xmlns="http://www.w3.org/1999/xhtml">
Returns the items of $sourceSeq in an implementation dependent order.
</p><p xmlns="http://www.w3.org/1999/xhtml">
Note:
</p><p xmlns="http://www.w3.org/1999/xhtml">
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.
</p>
</api:summary><api:params><api:param name="sourceSeq" type="item()*"><api:param-description>
  The sequence of items. 
  <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">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 
  <a href="./xdmp.arrayValues">xdmp.arrayValues</a> on the array. </span>
  </api:param-description><api:param-name>sourceSeq</api:param-name><api:param-type>ValueIterator</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.unordered(xdmp.arrayValues([1, 3, 2]));

=&gt; 1, 3, 2
</pre></api:example></api:function></api:function-page>