Skip to main content

$$contains

Checks whether an array contains a certain value

Usage​

{
"$$contains": [ /* arrays / elements */ ],
"that": /* value */
}
"$$contains(<that>):{input}"

Returns​

boolean

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray of arrays / elements (null elements are ignored)
thatAnyValue to test for

Examples​

Input

Definition

Output

[0, [], "a"]
{ 
"$$contains": "$",
"that": "a"
}
true
[0, [], "a"]
{ 
"$$contains": "$",
"that": "b"
}
false
[0, [], "a"]
"$$contains(a):$"
true
[0, [], "a"]
"$$contains(b):$"
false