Loading TOC...

MarkLogic Server 11.0 Product Documentation
ort:value-count

ort:value-count(
   $value as ort:value
) as xs:unsignedLong

Summary

Returns the number of ort:value in an ort:value with value type "SEQUENCE", and always return 2 for "MAP".

Parameters
$value An ort:value, with value type "SEQUENCE" or "MAP".

Example

  let $m := ort:map(ort:string(("key1", "key2"),(2)),ort:value((1,2),(2),"float"))
  return ort:value-count($m)
  =>
  2

Example

  let $s := ort:sequence((ort:value((2,3),(2),"float"),ort:value((1),(1),"float"),ort:value((2),(1),"float")))
  return ort:value-count($s)
  =>
  3

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