Skip to content

#contains

Returns true when an array or string contains the provided value.

#contains(value, search)
Category Strings and arraysValid in Property value
Name Type Description
value path | string | array The string or array to search.
search any The value to find.

boolean

source.json
{
"text": "hello world",
"tags": [ "a", "b" ]
}
transformer.json
{
"inText": "#contains($.text, 'world')",
"inTags": "#contains($.tags, 'c')"
}
output.json
{
"inText": true,
"inTags": false
}

Try it in the playground →

#indexOf · #any