#select
Returns an array of the results of projecting each element.
#select(array, @x: projection)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
array |
path | array |
The source array. |
projection |
lambda |
Computes each output element. |
Returns
Section titled “Returns”array
Examples
Section titled “Examples”Project a property
Section titled “Project a property”{ "some": { "complexArray": [ { "some": { "path": 5 } }, { "some": { "path": 30 } } ] }}{ "projectedData": "#valueOf($.some.complexArray)->#select(@x: @x.some.path)"}{ "projectedData": [ 5, 30 ]}