Skip to main content

$$lte

Checks if value is less than or equal to another value

Usage​

{ 
"$$lte": /* A value which `value` should be less than or equal to (value <= input) */,
"value": /* any */,
"strict": false /* boolean */
}
"$$lte(<value>,[strict]):{input}"
note

Concrete values in the usage example are default values.

Returns​

boolean

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
InputobjectYesA value which value should be less than or equal to (value <= input)
valueanyYesValue to check against
strictbooleanfalse/truefalseDisable input type coercion between string to numbers (if value is number)

Examples​

Input

Definition

Output

"A"
{
"$$lte": "B",
"value": "$"
}
true
"B"
{
"$$lte": "A",
"value": "$"
}
false
4
{
"$$lte": 5,
"value": "$"
}
true
4
{
"$$lte": 4,
"value": "$"
}
true
4
{
"$$lte": 3,
"value": "$"
}
false
4
{
"$$lte": "5",
"value": "$"
}
true
4
{
"$$lte": "5",
"value": "$",
"strict": true
}
false
[
1
]
{
"$$lte": [
1,
2
],
"value": "$"
}
true
{
"a": true
}
{
"$$lte": {
"a": true,
"b": true
},
"value": "$"
}
true
"A"
"$$lte($):B"
true
4
"$$lte($):5"
true
4
"$$lte($,true):5"
false