$$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​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | object | Yes | Value to check against | |
op | enum | IN / NIN /EQ /= /== /NEQ / != /<> /GT /> /GTE / >= /LT /< /LTE /<= | null | A type of check to do exclusively (goes together with that ) |
that | any | null | ||
in | array | null | Array of values the input should be part of | |
nin | array | null | Array of values the input should NOT be part of | |
eq | any | null | A value the input should be equal to | |
neq | any | null | A value the input should NOT be equal to | |
gt | any | null | A value the input should be greater than (input > value) | |
gte | any | null | A value the input should be greater than or equal (input >= value) | |
lt | any | null | A value the input should be lower than (input < value) | |
lte | any | null | A 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