<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.countAggregate.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.countAggregate</api:function-name><api:suggest>cts.countaggregate</api:suggest><api:suggest>cts</api:suggest><api:suggest>countaggregate</api:suggest><api:function-link mode="xquery" fullname="cts:count-aggregate">/apidoc/8.0/cts:count-aggregate.xml</api:function-link><api:function mode="javascript" name="countAggregate" type="builtin" lib="cts" category="SearchBuiltins" subcategory="Math Lexicon" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.countAggregate"><api:summary>
  Returns the count of a value lexicon.
  This function works like <code xmlns="http://www.w3.org/1999/xhtml">cts:count</code> except it performs the
  counting in parallel in all data nodes then aggregates the values. It
  generally performs better than <code xmlns="http://www.w3.org/1999/xhtml">cts:count</code>, especially on
  large clusters.
</api:summary><api:params><api:param name="range-index" type="cts:reference"><api:param-description>
    Reference to a range index.
  </api:param-description><api:param-name>range-index</api:param-name><api:param-type>cts.reference</api:param-type></api:param><api:param name="options" type="xs:string*" optional="true"><api:param-description>
    Same as the "options" parameter in <code xmlns="http://www.w3.org/1999/xhtml">cts:aggregate</code>.
  </api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param><api:param name="query" type="cts:query?" optional="true"><api:param-description>
     Same as the "query" parameter in <code xmlns="http://www.w3.org/1999/xhtml">cts:aggregate</code>.
  </api:param-description><api:param-name>query</api:param-name><api:param-type>cts.query?</api:param-type></api:param><api:param name="forest-ids" type="xs:unsignedLong*" optional="true"><api:param-description>
     Same as the "forest-ids" parameter in <code xmlns="http://www.w3.org/1999/xhtml">cts:aggregate</code>.
  </api:param-description><api:param-name>forest-ids</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>Number</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
cts.countAggregate(cts.pathReference("/path/index"));
=&gt;
12
</pre></api:example></api:function></api:function-page>