Skip to main content

$$filter

Filter input array to all the elements that satisfy the predicate transformer.

Usage​

{
"$$filter": [ /* values */ ],
"by": /* Transformer */
}

Returns​

array (same items type as input)

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

[
"a",
null,
"b",
"",
false,
true
]
{ 
"$$filter": "$",
"by": "##current"
}
[
"a",
"b",
true
]