Skip to content

#select

Returns an array of the results of projecting each element.

#select(array, @x: projection)
Category Arrays and sequencesValid in Property value
Name Type Description
array path | array The source array.
projection lambda Computes each output element.

array

source.json
{
"some": {
"complexArray": [ { "some": { "path": 5 } }, { "some": { "path": 30 } } ]
}
}
transformer.json
{
"projectedData": "#valueOf($.some.complexArray)->#select(@x: @x.some.path)"
}
output.json
{
"projectedData": [ 5, 30 ]
}

Try it in the playground →

#where · #foreach