MarkLogic Server 11.0 Product Documentation
json:array-with

json:array-with(
   $array as json:array,
   $item as item()*
) as json:array

Summary

Push a value to the end of the array, increasing the size of the array by one. Returns the array as the result.

Parameters
array An array.
item New entries.

Example

  let $a := json:to-array(1 to 3)
    =>json:array-with(4)
  return xdmp:to-json($a)
  => [1, 2, 3, 4]
Powered by MarkLogic Server | Terms of Use | Privacy Policy