Oihana PHP Arango

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 == 2 returns false
  • [ 2, 2, 2 ] ALL == 2 returns true
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo allEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ALL == 2

echo allEqual('scores', 10);
// scores ALL == 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 > 2 returns true
  • [ 1, 2, 3 ] ALL > 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo allGreaterThan('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ALL > 2

echo allGreaterThan('scores', 10);
// scores ALL > 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 >= 2 returns true
  • [ 1, 2, 3 ] ALL >= 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo allGreaterThanOrEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ALL >= 2

echo allGreaterThanOrEqual('scores', 10);
// scores ALL >= 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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] returns true
  • [1, 2, 4] ALL IN [1, 2, 3] returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The array or expression to check membership against.

Tags
example
echo allIn('[1, 2, 3]', '[1, 2, 3]');
// [1, 2, 3] ALL IN [1, 2, 3]

echo allIn('scores', '[10, 20, 30]');
// scores ALL IN [10, 20, 30]
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 < 6 returns true
  • [ 1, 2, 3 ] ALL < 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo allLessThan('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ALL < 2

echo allLessThan('scores', 10);
// scores ALL < 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 <= 5 returns true
  • [ 1, 2, 3 ] ALL <= 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo allGreaterThanOrEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ALL <= 2

echo allGreaterThanOrEqual('scores', 10);
// scores ALL <= 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 != 4 returns true
  • [ 2, 2, 2 ] ALL != 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo allEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ALL != 2

echo allEqual('scores', 10);
// scores ALL != 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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] returns true
  • [1, 2, 3] ALL NOT IN [1, 2, 3] returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The array or expression to check membership against.

Tags
example
echo allNotIn('[1, 2, 3]', '[4, 5, 6]');
// [1, 2, 3] ALL NOT IN [4, 5, 6]

echo allNotIn('scores', '[10, 20, 30]');
// scores ALL NOT IN [10, 20, 30]
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0

author Marc Alcaraz

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 == 2 returns true
  • [ 1, 2, 3 ] ANY == 5 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo anyEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ANY == 2

echo anyEqual('scores', 10);
// scores ANY == 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 > 2 returns true
  • [ 1, 2, 3 ] ANY > 5 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo anyGreaterThan('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ANY > 2

echo anyGreaterThan('scores', 10);
// scores ANY > 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 >= 2 returns true
  • [ 1, 2, 3 ] ANY >= 5 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo anyGreaterThanOrEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ANY >= 2

echo anyGreaterThanOrEqual('scores', 10);
// scores ANY >= 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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] returns true
  • [1, 2, 4] ANY IN [1, 2, 3] returns true (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
example
echo anyIn('[1, 2, 3]', '[1, 2, 3]');
// [1, 2, 3] ANY IN [1, 2, 3]

echo anyIn('scores', '[10, 20, 30]');
// scores ANY IN [10, 20, 30]
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 < 6 returns true
  • [ 1, 2, 3 ] ANY < 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo anyLessThan('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ANY < 2

echo anyLessThan('scores', 10);
// scores ANY < 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 <= 5 returns true
  • [ 1, 2, 3 ] ANY <= 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo anyLessThanOrEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ANY <= 2

echo anyLessThanOrEqual('scores', 10);
// scores ANY <= 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 != 4 returns true
  • [ 2, 2, 2 ] ANY != 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo anyNotEqual('[ 1, 2, 3 ]', 2);
// [ 1, 2, 3 ] ANY != 2

echo anyNotEqual('scores', 10);
// scores ANY != 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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] returns true
  • [1, 2, 3] ANY NOT IN [1, 2, 3] returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The array or expression to check membership against.

Tags
example
echo anyNotIn('[1, 2, 3]', '[4, 5, 6]');
// [1, 2, 3] ANY NOT IN [4, 5, 6]

echo anyNotIn('scores', '[10, 20, 30]');
// scores ANY NOT IN [10, 20, 30]
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 == 2 returns true
  • 3 == 2 returns false
Parameters
$leftOperand : mixed

The left-hand value or expression.

$rightOperand : mixed

The right-hand value or expression to compare against.

Tags
example
echo equal('a', 12);
// a == 12

echo equal('doc.age', 18);
// doc.age == 18
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 > 2 returns true
  • 2 > 3 returns false
Parameters
$leftOperand : mixed

The left-hand value or expression.

$rightOperand : mixed

The right-hand value or expression to compare against.

Tags
example
echo greaterThan('a', 12);
// a > 12

echo greaterThan('doc.score', 90);
// doc.score > 90
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 >= 3 returns true
  • 2 >= 3 returns false
Parameters
$leftOperand : mixed

The left-hand value or expression.

$rightOperand : mixed

The right-hand value or expression to compare against.

Tags
example
echo greaterThanOrEqual('a', 12);
// a >= 12

echo greaterThanOrEqual('doc.score', 90);
// doc.score >= 90
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 ] returns true
  • 42 IN [ 2, 3, 1.5 ] returns false
Parameters
$leftOperand : mixed

The value or expression to look for.

$rightOperand : mixed

The array expression to search in.

Tags
example
echo in('1.5', '[ 2, 3, 1.5 ]');
// 1.5 IN [ 2, 3, 1.5 ]

echo in('user.role', "['admin','user']");
// user.role IN ['admin','user']
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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%" returns true
  • "bar" LIKE "f%" returns false
Parameters
$leftOperand : mixed

The string value or expression to test.

$rightOperand : mixed

The LIKE pattern expression.

Tags
example
echo isLike('"foo"', '"f%"');
// "foo" LIKE "f%"

echo isLike('doc.name', '"A_%"');
// doc.name LIKE "A_%"
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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].$" returns true
  • "bar" =~ "^f[o].$" returns false
Parameters
$leftOperand : mixed

The string value or expression to test.

$rightOperand : mixed

The regular expression pattern.

Tags
example
echo isMatch('"foo"', '"^f[o].$"');
// "foo" =~ "^f[o].$"

echo isMatch('doc.name', '"^[A-Z].+"');
// doc.name =~ "^[A-Z].+"
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 < 3 returns true
  • 3 < 2 returns false
Parameters
$leftOperand : mixed

The left-hand value or expression.

$rightOperand : mixed

The right-hand value or expression to compare against.

Tags
example
echo lessThan('a', 12);
// a < 12

echo lessThan('doc.score', 90);
// doc.score < 90
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 <= 3 returns true
  • 4 <= 3 returns false
Parameters
$leftOperand : mixed

The left-hand value or expression.

$rightOperand : mixed

The right-hand value or expression to compare against.

Tags
example
echo lessThanOrEqual('a', 12);
// a <= 12

echo lessThanOrEqual('doc.score', 90);
// doc.score <= 90
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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
example

echo logicalAnd('a == 2', 'b == 3'); // a == 2 && b == 3

see
https://docs.arangodb.com/stable/aql/operators/#logical-operators
since
1.0.0
author

Marc Alcaraz

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 == 2 when 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/$right characters (default: false).

Tags
example

echo logicalNot('a == 2'); // !a == 2

echo logicalNot('a == 2', true); // !(a == 2)

see
https://docs.arangodb.com/stable/aql/operators/#logical-operators
since
1.0.0
author

Marc Alcaraz

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
example

echo logicalOr('a == 2', 'b == 3'); // a == 2 || b == 3

see
https://docs.arangodb.com/stable/aql/operators/#logical-operators
since
1.0.0
author

Marc Alcaraz

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 == 4 returns true
  • [ 1, 2, 3 ] NONE == 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo noneEqual('[ 1, 2, 3 ]', 4);
// [ 1, 2, 3 ] NONE == 4

echo noneEqual('scores', 10);
// scores NONE == 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 > 5 returns true
  • [ 1, 2, 3 ] NONE > 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo noneGreaterThan('[ 1, 2, 3 ]', 5);
// [ 1, 2, 3 ] NONE > 5

echo noneGreaterThan('scores', 10);
// scores NONE > 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 >= 6 returns true
  • [ 1, 2, 3 ] NONE >= 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo noneGreaterThanOrEqual('[ 1, 2, 3 ]', 6);
// [ 1, 2, 3 ] NONE >= 6

echo noneGreaterThanOrEqual('scores', 10);
// scores NONE >= 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 ] returns true
  • [ 1, 2, 3 ] NONE IN [ 2, 5, 6 ] returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The array or expression to test membership in.

Tags
example
echo noneIn('[ 1, 2, 3 ]', '[ 4, 5, 6 ]');
// [ 1, 2, 3 ] NONE IN [ 4, 5, 6 ]

echo noneIn('tags', '[ "a", "b" ]');
// tags NONE IN [ "a", "b" ]
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 < 1 returns true
  • [ 1, 2, 3 ] NONE < 3 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo noneLessThan('[ 1, 2, 3 ]', 1);
// [ 1, 2, 3 ] NONE < 1

echo noneLessThan('scores', 10);
// scores NONE < 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 <= 0 returns true
  • [ 1, 2, 3 ] NONE <= 2 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo noneLessThanOrEqual('[ 1, 2, 3 ]', 0);
// [ 1, 2, 3 ] NONE <= 0

echo noneLessThanOrEqual('scores', 10);
// scores NONE <= 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 != 4 returns true
  • [ 1, 2, 3 ] NONE != 3 returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The value or expression to compare against.

Tags
example
echo noneNotEqual('[ 1, 2, 3 ]', 4);
// [ 1, 2, 3 ] NONE != 4

echo noneNotEqual('scores', 10);
// scores NONE != 10
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 ] returns true
  • [ 1, 2, 3 ] NONE NOT IN [ 4, 5, 6 ] returns false
Parameters
$leftOperand : mixed

The array or expression to evaluate.

$rightOperand : mixed

The array or expression to test membership against.

Tags
example
echo noneNotIn('[ 1, 2, 3 ]', '[ 1, 2, 3 ]');
// [ 1, 2, 3 ] NONE NOT IN [ 1, 2, 3 ]

echo noneNotIn('tags', '[ "a", "b" ]');
// tags NONE NOT IN [ "a", "b" ]
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 != 3 returns true
  • 2 != 2 returns false
Parameters
$leftOperand : mixed

The left-hand value or expression.

$rightOperand : mixed

The right-hand value or expression to compare against.

Tags
example
echo notEqual('a', 12);
// a != 12

echo notEqual('doc.age', 18);
// doc.age != 18
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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 ] returns true
  • 1.5 NOT IN [ 2, 3, 1.5 ] returns false
Parameters
$leftOperand : mixed

The value or expression to look for.

$rightOperand : mixed

The array expression to search in.

Tags
example
echo notIn('42', '[ 2, 3, 1.5 ]');
// 42 NOT IN [ 2, 3, 1.5 ]

echo notIn('user.role', "['admin','user']");
// user.role NOT IN ['admin','user']
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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%" returns false
  • "bar" NOT LIKE "f%" returns true
Parameters
$leftOperand : mixed

The string value or expression to test.

$rightOperand : mixed

The LIKE pattern expression.

Tags
example
echo notLike('"foo"', '"f%"');
// "foo" NOT LIKE "f%"

echo notLike('doc.name', '"A_%"');
// doc.name NOT LIKE "A_%"
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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].$" returns false
  • "bar" !~ "^f[o].$" returns true
Parameters
$leftOperand : mixed

The string value or expression to test.

$rightOperand : mixed

The regular expression pattern.

Tags
example
echo notMatch('"foo"', '"^f[o].$"');
// "foo" !~ "^f[o].$"

echo notMatch('doc.name', '"^[A-Z].+"');
// doc.name !~ "^[A-Z].+"
see
https://docs.arangodb.com/stable/aql/operators/#array-comparison-operators
since
1.0.0
author

Marc Alcaraz

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
example
echo rangeOperator(2010, 2013);
// Outputs: "2010 .. 2013"

echo rangeOperator('1', '5');
// Outputs: "1 .. 5"
see
https://docs.arangodb.com/3.11/aql/operators/#range-operator
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 $condition is 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
example
$expr = ternary('IS_ARRAY(doc.tags)', 'FIRST(doc.tags)', 'null');
// Produces: 'IS_ARRAY(doc.tags) ? FIRST(doc.tags) : null'
Return values
string

The assembled ternary expression as a string.

On this page

Search results