Skip to main content

$$is

Checks value for one or more predicates (all predicates must be satisfied)

Usage​

{ 
"$$is": /* Value to check against */,
"op": /* IN / NIN / EQ / = / == / NEQ / != / <> / GT / > / GTE / >= / LT / < / LTE / <= */,
"that": /* any */,
"in": /* array */,
"nin": /* array */,
"eq": /* any */,
"neq": /* any */,
"gt": /* any */,
"gte": /* any */,
"lt": /* any */,
"lte": /* any */
}
"$$is([op],[that]):{input}"
note

Inline form supports only that and op arguments.

tip

gt/gte/lt/lte - Uses the Comparison logic

Returns​

boolean

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryobjectYesValue to check against
openumIN/ NIN/EQ/=/==/NEQ/ !=/<>/GT/>/GTE/ >=/LT/</LTE/<=nullA type of check to do exclusively (goes together with that)
thatanynull
inarraynullArray of values the input should be part of
ninarraynullArray of values the input should NOT be part of
eqanynullA value the input should be equal to
neqanynullA value the input should NOT be equal to
gtanynullA value the input should be greater than (input > value)
gteanynullA value the input should be greater than or equal (input >= value)
ltanynullA value the input should be lower than (input < value)
lteanynullA value the input should be lower than or equal (input <= value)

Examples​

Input

Definition

Output

"A"
{
"$$is": "$",
"eq": "A"
}
true
"A"
{
"$$is": "$",
"eq": "B"
}
false
4
{
"$$is": "$",
"eq": 4
}
true
4.5
{
"$$is": "$",
"eq": 4
}
false
4.5
{
"$$is": "$",
"neq": 4
}
true
4.5
{
"$$is": "$",
"eq": 4.5,
"neq": 4
}
true
"B"
{
"$$is": "$",
"gt": "A"
}
true
"B"
{
"$$is": "$",
"gte": "B"
}
true
4
{
"$$is": "$",
"gt": 3
}
true
4
{
"$$is": "$",
"gte": 4
}
true
4
{
"$$is": "$",
"lte": 4
}
true
3
{
"$$is": "$",
"lt": 4
}
true
4
{
"$$is": "$",
"lt": 4
}
false
[
1,
2,
3
]
{
"$$is": "$",
"lt": [
true,
"a",
"b",
"c"
]
}
true
[
1,
2,
3
]
{
"$$is": "$",
"gte": [
"a",
"b",
"c"
]
}
true
{
"a": 1,
"b": 2
}
{
"$$is": "$",
"gte": {
"key1": "a",
"key2": "b"
}
}
true
"A"
{
"$$is": "$",
"in": [
"A",
"B"
]
}
true
[
"A",
"B"
]
{
"$$is": "A",
"in": "$"
}
true
[
"A",
"B"
]
{
"$$is": "B",
"in": [
"$[0]",
"$[1]"
]
}
true
[
"a",
"B"
]
{
"$$is": "A",
"in": "$"
}
false
[
false,
true
]
{
"$$is": true,
"in": "$"
}
true
null
{
"$$is": 30,
"in": [
10,
20,
30
]
}
true
null
{
"$$is": 30,
"nin": [
10,
20,
30
]
}
false
null
{
"$$is": 30,
"in": "$"
}
false
null
{
"$$is": 30,
"nin": "$"
}
false
null
{
"$$is": [
{
"a": 1
}
],
"in": [
[
{
"a": 4
}
],
[
{
"a": 1
}
],
[
{
"a": 3
}
]
]
}
true
null
{
"$$is": 30,
"in": [
10,
20,
30
],
"nin": [
40,
50,
60
]
}
true
null
{
"$$is": 30,
"in": [
40,
50,
60
],
"nin": [
10,
20,
30
]
}
false
2
{
"$$is": true,
"in": [
{
"$$is": "$",
"gt": 1,
"lt": 3
},
{
"$$is": "$",
"gte": 4,
"lte": 6
}
]
}
true
4
{
"$$is": true,
"in": [
{
"$$is": "$",
"gt": 1,
"lt": 3
},
{
"$$is": "$",
"gte": 4,
"lte": 6
}
]
}
true
5
{
"$$is": true,
"in": [
{
"$$is": "$",
"gt": 1,
"lt": 3
},
{
"$$is": "$",
"gte": 4,
"lte": 6
}
]
}
true
6
{
"$$is": true,
"in": [
{
"$$is": "$",
"gt": 1,
"lt": 3
},
{
"$$is": "$",
"gte": 4,
"lte": 6
}
]
}
true
1
{
"$$is": true,
"in": [
{
"$$is": "$",
"gt": 1,
"lt": 3
},
{
"$$is": "$",
"gte": 4,
"lte": 6
}
]
}
false
3
{
"$$is": true,
"in": [
{
"$$is": "$",
"gt": 1,
"lt": 3
},
{
"$$is": "$",
"gte": 4,
"lte": 6
}
]
}
false
7
{
"$$is": true,
"in": [
{
"$$is": "$",
"gt": 1,
"lt": 3
},
{
"$$is": "$",
"gte": 4,
"lte": 6
}
]
}
false
"A"
{
"$$is": "$",
"op": "EQ",
"that": "A"
}
true
"A"
{
"$$is": "$",
"op": "EQ",
"that": "B"
}
false
"A"
{
"$$is": "$",
"op": "!=",
"that": "B"
}
true
5
{
"$$is": "$",
"op": ">",
"that": 2
}
true
"A"
"$$is(EQ,A):$"
true
"A"
"$$is(=,B):$"
false
"A"
"$$is(!=,B):$"
true
"10"
"$$is(>,2):$"
false
10
"$$is(>,2):$"
true
[
"a",
"b",
"A",
"B"
]
"$$is(IN,$):A"
true
[
"a",
"b",
"A",
"B"
]
"$$is(IN,$):C"
false
[
"a",
"b",
"A",
"B"
]
"$$is(NIN,$):C"
true
null
"$$is(in,$):C"
false
null
"$$is(Nin,$):C"
false
null
"$$is(!=,#null):$"
false
null
"$$is(=,#null):$"
true