Loading TOC...

cts:count-aggregate

cts:count-aggregate(
   $range-index as cts:reference,
   [$options as xs:string*],
   [$query as cts:query?],
   [$forest-ids as xs:unsignedLong*]
) as xs:integer

Summary

Returns the count of a value lexicon. This function works like cts:count except it performs the counting in parallel in all data nodes then aggregates the values. It generally performs better than cts:count, especially on large clusters.

Parameters
$range-index Reference to a range index.
$options Same as the "options" parameter in cts:aggregate.
$query Same as the "query" parameter in cts:aggregate.
$forest-ids Same as the "forest-ids" parameter in cts:aggregate.

Example

cts:count-aggregate(cts:path-reference("/path/index"))
=>
12

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.