$$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​
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
[
"a",
null,
"b",
"",
false,
true
]
{
"$$filter": "$",
"by": "##current"
}
[
"a",
"b",
true
]