Skip to main content

$$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​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray of elements
byTransformer(##current)Input is ##current (current element)YesA 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 }