Skip to content

Latest commit

 

History

History
20 lines (18 loc) · 520 Bytes

array.md

File metadata and controls

20 lines (18 loc) · 520 Bytes

Operations for Array

  1. $loop

$loop

$loop applies specified operation to each item in the array. The value of $loop must be an array with two items in it, the first item must be an array (parameter array), the second must be a string specifing the operation. Each item in the parameter array must be suitable for the parameter of the operation.

For example, giving JSON:

{
    "scores": {
        "$loop": [[1, 100, -2], "$abs"]
    }
}

will produce:

{
    "scores": [1, 100, 2]
}