operators
Table of Contents
Functions
- allEqual() : string
- Returns an AQL expression that checks if **all elements** of an array satisfy a comparison.
- allGreaterThan() : string
- Returns an AQL expression that checks if **all elements** of an array are greater than a given value.
- allGreaterThanOrEqual() : string
- Returns an AQL expression that checks if **all elements** of an array are greater than or equal to a given value.
- allIn() : string
- Returns an AQL expression that checks if **all elements** of an array are contained in another array.
- allLessThan() : string
- Returns an AQL expression that checks if **all elements** of an array are less than a given value.
- allLessThanOrEqual() : string
- Returns an AQL expression that checks if **all elements** of an array are less than or equal to a given value.
- allNotEqual() : string
- Returns an AQL expression that checks if **all elements** of an array are **not equal** to a given value.
- allNotIn() : string
- Returns an AQL expression that checks if **all elements** of an array are **not contained** in another array.
- anyEqual() : string
- Returns an AQL expression that checks if **any elements** of an array satisfy a comparison.
- anyGreaterThan() : string
- Returns an AQL expression that checks if **any elements** of an array are greater than a given value.
- anyGreaterThanOrEqual() : string
- Returns an AQL expression that checks if **any elements** of an array are greater than or equal to a given value.
- anyIn() : string
- Returns an AQL expression that checks if **any elements** of an array are contained in another array.
- anyLessThan() : string
- Returns an AQL expression that checks if **any elements** of an array are less than a given value.
- anyLessThanOrEqual() : string
- Returns an AQL expression that checks if **any elements** of an array are less than or equal to a given value.
- anyNotEqual() : string
- Returns an AQL expression that checks if **any elements** of an array are **not equal** to a given value.
- anyNotIn() : string
- Returns an AQL expression that checks if **any elements** of an array are **not contained** in another array.
- equal() : string
- Returns an AQL expression that checks if the left operand is equal to the right operand.
- greaterThan() : string
- Returns an AQL expression that checks if the left operand is greater than the right operand.
- greaterThanOrEqual() : string
- Returns an AQL expression that checks if the left operand is greater than or equal to the right operand.
- in() : string
- Returns an AQL expression that checks if the left operand is contained in the right operand array.
- isLike() : string
- Returns an AQL expression that checks if the left string matches the right LIKE pattern.
- isMatch() : string
- Returns an AQL expression that checks if the left string matches the right regular expression.
- lessThan() : string
- Returns an AQL expression that checks if the left operand is less than the right operand.
- lessThanOrEqual() : string
- Returns an AQL expression that checks if the left operand is less than or equal to the right operand.
- logicalAnd() : string
- Returns an AQL expression that combines two predicates using the logical AND operator (&&).
- logicalNot() : string
- Returns an AQL expression that negates a predicate using the logical NOT operator (!).
- logicalOr() : string
- Returns an AQL expression that combines two predicates using the logical OR operator (||).
- noneEqual() : string
- Returns an AQL expression that checks if none of the elements of an array are equal to a value.
- noneGreaterThan() : string
- Returns an AQL expression that checks if none of the elements of an array are greater than a value.
- noneGreaterThanOrEqual() : string
- Returns an AQL expression that checks if none of the elements of an array are greater than or equal to a value.
- noneIn() : string
- Returns an AQL expression that checks if none of the elements of an array are contained in another array.
- noneLessThan() : string
- Returns an AQL expression that checks if none of the elements of an array are less than a value.
- noneLessThanOrEqual() : string
- Returns an AQL expression that checks if none of the elements of an array are less than or equal to a value.
- noneNotEqual() : string
- Returns an AQL expression that checks if none of the elements of an array are equal to a value (i.e., all elements are different).
- noneNotIn() : string
- Returns an AQL expression that checks if none of the elements of an array are contained in another array (NOT IN).
- notEqual() : string
- Returns an AQL expression that checks if the left operand is not equal to the right operand.
- notIn() : string
- Returns an AQL expression that checks if the left operand is not contained in the right operand array.
- notLike() : string
- Returns an AQL expression that checks if the left string does not match the right LIKE pattern.
- notMatch() : string
- Returns an AQL expression that checks if the left string does not match the right regular expression.
- nullish() : string
- Generates a shorthand nullish ternary expression.
- rangeOperator() : string
- Generates an AQL range expression using the range operator (`..`).
- ternary() : string
- Builds a ternary AQL (or general) expression as a string.
Functions
allEqual()
Returns an AQL expression that checks if **all elements** of an array satisfy a comparison.
allEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL == array comparison operator.
Example:
[ 1, 2, 3 ] ALL == 2returnsfalse[ 2, 2, 2 ] ALL == 2returnstrue
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
allGreaterThan()
Returns an AQL expression that checks if **all elements** of an array are greater than a given value.
allGreaterThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL > array comparison operator.
Example:
[ 3, 4, 5 ] ALL > 2returnstrue[ 1, 2, 3 ] ALL > 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
allGreaterThanOrEqual()
Returns an AQL expression that checks if **all elements** of an array are greater than or equal to a given value.
allGreaterThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL >= array comparison operator.
Example:
[ 3, 4, 5 ] ALL >= 2returnstrue[ 1, 2, 3 ] ALL >= 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
allIn()
Returns an AQL expression that checks if **all elements** of an array are contained in another array.
allIn(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL IN array comparison operator.
Example:
[1, 2, 3] ALL IN [1, 2, 3]returnstrue[1, 2, 4] ALL IN [1, 2, 3]returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The array or expression to check membership against.
Tags
Return values
string —The AQL predicate string.
allLessThan()
Returns an AQL expression that checks if **all elements** of an array are less than a given value.
allLessThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL < array comparison operator.
Example:
[ 3, 4, 5 ] ALL < 6returnstrue[ 1, 2, 3 ] ALL < 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
allLessThanOrEqual()
Returns an AQL expression that checks if **all elements** of an array are less than or equal to a given value.
allLessThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL <= array comparison operator.
Example:
[ 3, 4, 5 ] ALL <= 5returnstrue[ 1, 2, 3 ] ALL <= 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
allNotEqual()
Returns an AQL expression that checks if **all elements** of an array are **not equal** to a given value.
allNotEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL != array comparison operator.
Example:
[ 1, 2, 3 ] ALL != 4returnstrue[ 2, 2, 2 ] ALL != 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
allNotIn()
Returns an AQL expression that checks if **all elements** of an array are **not contained** in another array.
allNotIn(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ALL NOT IN array comparison operator.
Example:
[1, 2, 3] ALL NOT IN [4, 5, 6]returnstrue[1, 2, 3] ALL NOT IN [1, 2, 3]returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The array or expression to check membership against.
Tags
Return values
string —The AQL predicate string.
anyEqual()
Returns an AQL expression that checks if **any elements** of an array satisfy a comparison.
anyEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY == array comparison operator.
Example:
[ 1, 2, 3 ] ANY == 2returnstrue[ 1, 2, 3 ] ANY == 5returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
anyGreaterThan()
Returns an AQL expression that checks if **any elements** of an array are greater than a given value.
anyGreaterThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY > array comparison operator.
Example:
[ 3, 4, 5 ] ANY > 2returnstrue[ 1, 2, 3 ] ANY > 5returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
anyGreaterThanOrEqual()
Returns an AQL expression that checks if **any elements** of an array are greater than or equal to a given value.
anyGreaterThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY >= array comparison operator.
Example:
[ 3, 4, 5 ] ANY >= 2returnstrue[ 1, 2, 3 ] ANY >= 5returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
anyIn()
Returns an AQL expression that checks if **any elements** of an array are contained in another array.
anyIn(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY IN array comparison operator.
Example:
[1, 2, 3] ANY IN [1, 2, 3]returnstrue[1, 2, 4] ANY IN [1, 2, 3]returnstrue(because 1 or 2 are in the second array)
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The array or expression to check membership against.
Tags
Return values
string —The AQL predicate string.
anyLessThan()
Returns an AQL expression that checks if **any elements** of an array are less than a given value.
anyLessThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY < array comparison operator.
Example:
[ 3, 4, 5 ] ANY < 6returnstrue[ 1, 2, 3 ] ANY < 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
anyLessThanOrEqual()
Returns an AQL expression that checks if **any elements** of an array are less than or equal to a given value.
anyLessThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY <= array comparison operator.
Example:
[ 3, 4, 5 ] ANY <= 5returnstrue[ 1, 2, 3 ] ANY <= 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
anyNotEqual()
Returns an AQL expression that checks if **any elements** of an array are **not equal** to a given value.
anyNotEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY != array comparison operator.
Example:
[ 1, 2, 3 ] ANY != 4returnstrue[ 2, 2, 2 ] ANY != 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
anyNotIn()
Returns an AQL expression that checks if **any elements** of an array are **not contained** in another array.
anyNotIn(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB ANY NOT IN array comparison operator.
Example:
[1, 2, 3] ANY NOT IN [4, 5, 6]returnstrue[1, 2, 3] ANY NOT IN [1, 2, 3]returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The array or expression to check membership against.
Tags
Return values
string —The AQL predicate string.
equal()
Returns an AQL expression that checks if the left operand is equal to the right operand.
equal(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB == comparison operator.
Example:
2 == 2returnstrue3 == 2returnsfalse
Parameters
- $leftOperand : mixed
-
The left-hand value or expression.
- $rightOperand : mixed
-
The right-hand value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
greaterThan()
Returns an AQL expression that checks if the left operand is greater than the right operand.
greaterThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB > comparison operator.
Example:
3 > 2returnstrue2 > 3returnsfalse
Parameters
- $leftOperand : mixed
-
The left-hand value or expression.
- $rightOperand : mixed
-
The right-hand value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
greaterThanOrEqual()
Returns an AQL expression that checks if the left operand is greater than or equal to the right operand.
greaterThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB >= comparison operator.
Example:
3 >= 3returnstrue2 >= 3returnsfalse
Parameters
- $leftOperand : mixed
-
The left-hand value or expression.
- $rightOperand : mixed
-
The right-hand value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
in()
Returns an AQL expression that checks if the left operand is contained in the right operand array.
in(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB IN comparison operator.
Example:
1.5 IN [ 2, 3, 1.5 ]returnstrue42 IN [ 2, 3, 1.5 ]returnsfalse
Parameters
- $leftOperand : mixed
-
The value or expression to look for.
- $rightOperand : mixed
-
The array expression to search in.
Tags
Return values
string —The AQL predicate string.
isLike()
Returns an AQL expression that checks if the left string matches the right LIKE pattern.
isLike(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB LIKE comparison operator.
Example:
"foo" LIKE "f%"returnstrue"bar" LIKE "f%"returnsfalse
Parameters
- $leftOperand : mixed
-
The string value or expression to test.
- $rightOperand : mixed
-
The LIKE pattern expression.
Tags
Return values
string —The AQL predicate string.
isMatch()
Returns an AQL expression that checks if the left string matches the right regular expression.
isMatch(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB =~ regular expression match operator.
Example:
"foo" =~ "^f[o].$"returnstrue"bar" =~ "^f[o].$"returnsfalse
Parameters
- $leftOperand : mixed
-
The string value or expression to test.
- $rightOperand : mixed
-
The regular expression pattern.
Tags
Return values
string —The AQL predicate string.
lessThan()
Returns an AQL expression that checks if the left operand is less than the right operand.
lessThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB < comparison operator.
Example:
2 < 3returnstrue3 < 2returnsfalse
Parameters
- $leftOperand : mixed
-
The left-hand value or expression.
- $rightOperand : mixed
-
The right-hand value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
lessThanOrEqual()
Returns an AQL expression that checks if the left operand is less than or equal to the right operand.
lessThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB <= comparison operator.
Example:
2 <= 3returnstrue4 <= 3returnsfalse
Parameters
- $leftOperand : mixed
-
The left-hand value or expression.
- $rightOperand : mixed
-
The right-hand value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
logicalAnd()
Returns an AQL expression that combines two predicates using the logical AND operator (&&).
logicalAnd(mixed $leftOperand, mixed $rightOperand) : string
This function mirrors the LogicalTrait::and() method with a standalone functional API.
Example semantics:
a == 2 && b == 3
Parameters
- $leftOperand : mixed
-
The left-hand expression/predicate.
- $rightOperand : mixed
-
The right-hand expression/predicate.
Tags
Return values
string —The AQL predicate string.
logicalNot()
Returns an AQL expression that negates a predicate using the logical NOT operator (!).
logicalNot(mixed $expression[, bool $useParentheses = false ][, bool $trim = false ]) : string
This function mirrors the LogicalTrait::not() method with a standalone functional API.
Example semantics:
!(a == 2)when parentheses are requested!a == 2when parentheses are not requested
Parameters
- $expression : mixed
-
The expression or predicate to negate.
- $useParentheses : bool = false
-
If true, wrap the expression in parentheses.
- $trim : bool = false
-
Whether to trim existing
$left/$rightcharacters (default: false).
Tags
Return values
string —The AQL predicate string.
logicalOr()
Returns an AQL expression that combines two predicates using the logical OR operator (||).
logicalOr(mixed $leftOperand, mixed $rightOperand) : string
This function mirrors the LogicalTrait::or() method with a standalone functional API.
Example semantics:
a == 2 || b == 3
Parameters
- $leftOperand : mixed
-
The left-hand expression/predicate.
- $rightOperand : mixed
-
The right-hand expression/predicate.
Tags
Return values
string —The AQL predicate string.
noneEqual()
Returns an AQL expression that checks if none of the elements of an array are equal to a value.
noneEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE == array comparison operator.
Example:
[ 1, 2, 3 ] NONE == 4returnstrue[ 1, 2, 3 ] NONE == 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
noneGreaterThan()
Returns an AQL expression that checks if none of the elements of an array are greater than a value.
noneGreaterThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE > array comparison operator.
Example:
[ 1, 2, 3 ] NONE > 5returnstrue[ 1, 2, 3 ] NONE > 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
noneGreaterThanOrEqual()
Returns an AQL expression that checks if none of the elements of an array are greater than or equal to a value.
noneGreaterThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE >= array comparison operator.
Example:
[ 1, 2, 3 ] NONE >= 6returnstrue[ 1, 2, 3 ] NONE >= 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
noneIn()
Returns an AQL expression that checks if none of the elements of an array are contained in another array.
noneIn(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE IN array comparison operator.
Example:
[ 1, 2, 3 ] NONE IN [ 4, 5, 6 ]returnstrue[ 1, 2, 3 ] NONE IN [ 2, 5, 6 ]returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The array or expression to test membership in.
Tags
Return values
string —The AQL predicate string.
noneLessThan()
Returns an AQL expression that checks if none of the elements of an array are less than a value.
noneLessThan(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE < array comparison operator.
Example:
[ 1, 2, 3 ] NONE < 1returnstrue[ 1, 2, 3 ] NONE < 3returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
noneLessThanOrEqual()
Returns an AQL expression that checks if none of the elements of an array are less than or equal to a value.
noneLessThanOrEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE <= array comparison operator.
Example:
[ 1, 2, 3 ] NONE <= 0returnstrue[ 1, 2, 3 ] NONE <= 2returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
noneNotEqual()
Returns an AQL expression that checks if none of the elements of an array are equal to a value (i.e., all elements are different).
noneNotEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE != array comparison operator.
Example:
[ 1, 2, 3 ] NONE != 4returnstrue[ 1, 2, 3 ] NONE != 3returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
noneNotIn()
Returns an AQL expression that checks if none of the elements of an array are contained in another array (NOT IN).
noneNotIn(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NONE NOT IN array comparison operator.
Example:
[ 1, 2, 3 ] NONE NOT IN [ 1, 2, 3 ]returnstrue[ 1, 2, 3 ] NONE NOT IN [ 4, 5, 6 ]returnsfalse
Parameters
- $leftOperand : mixed
-
The array or expression to evaluate.
- $rightOperand : mixed
-
The array or expression to test membership against.
Tags
Return values
string —The AQL predicate string.
notEqual()
Returns an AQL expression that checks if the left operand is not equal to the right operand.
notEqual(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB != comparison operator.
Example:
2 != 3returnstrue2 != 2returnsfalse
Parameters
- $leftOperand : mixed
-
The left-hand value or expression.
- $rightOperand : mixed
-
The right-hand value or expression to compare against.
Tags
Return values
string —The AQL predicate string.
notIn()
Returns an AQL expression that checks if the left operand is not contained in the right operand array.
notIn(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NOT IN comparison operator.
Example:
42 NOT IN [ 2, 3, 1.5 ]returnstrue1.5 NOT IN [ 2, 3, 1.5 ]returnsfalse
Parameters
- $leftOperand : mixed
-
The value or expression to look for.
- $rightOperand : mixed
-
The array expression to search in.
Tags
Return values
string —The AQL predicate string.
notLike()
Returns an AQL expression that checks if the left string does not match the right LIKE pattern.
notLike(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB NOT LIKE comparison operator.
Example:
"foo" NOT LIKE "f%"returnsfalse"bar" NOT LIKE "f%"returnstrue
Parameters
- $leftOperand : mixed
-
The string value or expression to test.
- $rightOperand : mixed
-
The LIKE pattern expression.
Tags
Return values
string —The AQL predicate string.
notMatch()
Returns an AQL expression that checks if the left string does not match the right regular expression.
notMatch(mixed $leftOperand, mixed $rightOperand) : string
Equivalent to the ArangoDB !~ regular expression not-match operator.
Example:
"foo" !~ "^f[o].$"returnsfalse"bar" !~ "^f[o].$"returnstrue
Parameters
- $leftOperand : mixed
-
The string value or expression to test.
- $rightOperand : mixed
-
The regular expression pattern.
Tags
Return values
string —The AQL predicate string.
nullish()
Generates a shorthand nullish ternary expression.
nullish(string $condition[, mixed|null $defaultValue = null ]) : string
This is a variant of the ternary operator that only requires a condition and a default value.
The expression evaluates the $condition; if it is "truthy", the value is returned,
otherwise the $defaultValue is returned.
Example:
nullish('u.value', 'default') // Produces: "u.value ? : default"
Useful for building concise AQL expressions where you want to provide a fallback if a field is null, missing, or evaluates to false.
Parameters
- $condition : string
-
Boolean expression to evaluate (e.g. a field reference)
- $defaultValue : mixed|null = null
-
Value to return if the condition is false
Return values
string —A string representing the nullish ternary expression
rangeOperator()
Generates an AQL range expression using the range operator (`..`).
rangeOperator(int|float|string $minimum, int|float|string $maximum) : string
The range operator can be used in AQL FOR loops to iterate over
a sequence of numeric values, inclusive of both $minimum and $maximum.
Example output:
2010..2013
which can be iterated as [2010, 2011, 2012, 2013] in AQL queries.
Parameters
- $minimum : int|float|string
-
The start value of the range.
- $maximum : int|float|string
-
The end value of the range.
Tags
Return values
string —The AQL range expression as a string.
ternary()
Builds a ternary AQL (or general) expression as a string.
ternary(string $condition[, mixed|null $trueValue = null ][, mixed|null $falseValue = null ]) : string
Generates a string in the format:
condition ? trueValue : falseValue
The ternary operator evaluates the $condition:
- If
$conditionis true, the result is$trueValue. - Otherwise, the result is
$falseValue.
This is useful for dynamically constructing AQL expressions with conditional logic.
Parameters
- $condition : string
-
Boolean expression to evaluate (e.g., "IS_ARRAY(doc.tags)").
- $trueValue : mixed|null = null
-
Value or expression returned if the condition is true.
- $falseValue : mixed|null = null
-
Value or expression returned if the condition is false.
Tags
Return values
string —The assembled ternary expression as a string.