Loading TOC...


   $array as json:array,
   $newSize as xs:unsignedLong,
   [$zero as item()?]
) as empty-sequence()


Resize the array to the new size. If the new size is greater than the old size, the new entries will be null. If the new size if smaller than the old size, the extra entries will be removed.

array An array.
newSize New size.
zero The value to use to pad out the array, if necessary. By default the empty sequence is used.


  let $a := json:to-array(1 to 3)
  let $_ := json:array-resize($a, 4)
  return xdmp:to-json($a)
  => [1, 2, 3, null]

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