inRange.php
Table of Contents
Functions
- inRange() : string
- Match documents where an attribute is within a range (index-accelerated).
Functions
inRange()
Match documents where an attribute is within a range (index-accelerated).
inRange(string $path, mixed $low, mixed $high, bool $includeLow, bool $includeHigh) : string
Wraps the ArangoDB AQL function
IN_RANGE(path, low, high, includeLow, includeHigh). Inside a SEARCH
operation it searches more efficiently than the equivalent pair of
comparisons combined with AND; the same function also exists as a
miscellaneous function outside of SEARCH (hence the constant living in
MiscFunction).
low and high can be numbers or strings, but both must share the same
data type. Note that string ranges in SEARCH follow byte order, not the
Analyzer locale collation.
Example AQL usage:
IN_RANGE(doc.value, 3, 5, true, true) // 3 <= value <= 5
IN_RANGE(doc.value, "a", "f", true, false) // "a" <= value < "f"
Parameters
- $path : string
-
Attribute path expression to test (kept raw).
- $low : mixed
-
Minimum value of the range (JSON-encoded: strings are quoted, numbers kept raw).
- $high : mixed
-
Maximum value of the range (JSON-encoded, same data type as
$low). - $includeLow : bool
-
Whether the minimum value is included (left-closed interval).
- $includeHigh : bool
-
Whether the maximum value is included (right-closed interval).
Tags
Return values
string —The formatted AQL expression.