<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.documentOrder.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.documentOrder</api:function-name><api:suggest>cts.documentorder</api:suggest><api:suggest>cts</api:suggest><api:suggest>documentorder</api:suggest><api:function-link mode="xquery" fullname="cts:document-order">/apidoc/8.0/cts:document-order.xml</api:function-link><api:function mode="javascript" name="documentOrder" type="builtin" lib="cts" category="SearchBuiltins" subcategory="cts:order Constructors" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.documentOrder"><api:summary>
  Creates a document-based ordering clause, for use as an option to
  cts:search.
</api:summary><api:params><api:param name="options" type="xs:string*" optional="true"><api:param-description>
    Options.  The default is ().
    <p xmlns="http://www.w3.org/1999/xhtml">
      Options include:</p>
      <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
        <dt>"descending"</dt>
        <dd>Results should be returned in descending order of document.</dd>
        <dt>"ascending"</dt>
        <dd>Results should be returned in ascending order of document.</dd>
     </dl></blockquote>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>cts.order</api:return><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">Only one of "ascending" or "descending" may be specified
  in the options parameter.  If neither "ascending" nor "descending"
  is specified, then the default is "ascending".</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
cts.documentOrder("descending");
=&gt;
cts.documentOrder("descending")
</pre></api:example></api:function></api:function-page>