cts.max( range-index as cts.reference, [options as String[]], [query as cts.query?], [forest-ids as (Number|String)[]] ) as xs.anyAtomicType?
Returns the maximal value given a value lexicon.
This function performs the calculation in parallel in all data nodes then
aggregates the values. It generally performs better than fn:max
,
especially on large clusters.
// This query assumes an element range index is configured // in the database for the 'Amount' element. cts.max(cts.elementReference(xs.QName("Amount"))); => 162.9500000000000034
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.