Skip to main content

$$is

Returns true if all predicates arguments are satisfied.

Usage​

{
"$$is": /* value to check */,
"in": [ /* possible values */ ],
"nin": [ /* forbidden values */ ],
"eq": /* value to equal */,
"neq": /* value to not equal */,
"gt": /* value to be greater than */,
"gte": /* value to be greater than or equal */,
"lt": /* value to be lower than */,
"lte": /* value to be lower than or equal */,
}

Returns​

boolean

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryYesValue to check against
inarrayArray of values the input should be part of
ninarrayArray of values the input should NOT be part of
eq(same as input)A Value the input should be equal to
neqA Value the input should NOT be equal to
gt(same as input)A Value the input should be greater than (input > value)
gte(same as input)A Value the input should be greater than or equal (input >= value)
lt(same as input)A Value the input should be lower than (input < value)
lte(same as input)A Value the input should be lower than or equal (input <= value)

Examples​

Input

Definition

Output

"TEST"
{ "$$is": "$", "eq": "TEST" }
true
"TEST"
{ "$$is": "$", "neq": "TEST" }
false
"DEV"
{ "$$is": "$", "in": ["DEV","PROD"] }
true
"DEV"
{ "$$is": "$", "nin": ["DEV","TEST"] }
false
2
{ "$$is": "$", "gt": 1, "lt": 3 }
true
1
{ "$$is": "$", "gt": 1, "lt": 3 }
false
3
{ "$$is": "$", "gt": 1, "lt": 3 }
false
[ { "a": 1 } ]
{ 
"$$is": "$",
"in":[
[ {"a": 4} ],
[ {"a": 1} ],
[ {"a": 3} ]
]
}
true