Skip to content

#any

Returns true if an array or string has contents, or, with a lambda, if any element matches.

#any(value, @x: predicate?)
Category Arrays and sequencesValid in Property value
Name Type Description
value path | array | string The array or string to test.
predicate (optional) lambda When given, an element must satisfy it.

boolean

source.json
{
"some": { "integerArray": [ 1, 2, 6, 10 ] }
}
transformer.json
{
"hasValues": "#valueOf($.some.integerArray)->#any(@x: @x > 5)"
}
output.json
{
"hasValues": true
}

Try it in the playground →

#isEmpty · #where · #contains