$$find
Find the first element in a specified array that satisfy the predicate transformer.
Usage​
{
"$$find": [ /* values */ ],
"by": /* Transformer */
}
Returns​
Same as found element
info
by
should resolve to a boolean
value, it uses the truthy logic
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | array | Yes | Array of elements | |
by | Transformer(##current ) | Input is ##current (current element) | Yes | A predicate transformer for an element |
Examples​
Input
Definition
Output
[
"",
0,
null,
"1",
"0"
]
{
"$$find": "$",
"by": "##current"
}
"1"
[
{ "a": 0 },
{ "a": 1 }
]
{
"$$find": "$",
"by": "##current.a"
}
{ "a": 1 }