Array Operators

OperatorDescriptionExample
$sizeReturns the size of the array argument. The argument must resolve to an array{“$size”: “body”}
$sliceReturns the subset of an array.
Param 1: The master array
Param 2 (optional): the position to start evaluating the array from
Param 3: the number of elements from param 2 to return

{ $slice: [ [ 1, 5, 7, 9 ], 1, 2 ] }

// returns [5, 7]

$isArrayReturns true if the operand is an array{"$isArray": [1,2,3]}
// returns true
$concatArraysReturns an array which contains all the arrays concatenated together.

{"$concatArrays": [ [ "medable", "is"], [ "great" ] ] }

//returns ["medable", "is", "great"]

$arrayElemAtReturns the element in the array at a specified index.

{ $arrayElemAt: [ [ "purple", "orange", "yellow" ], 1 ] }

//returns "orange"