Oihana PHP Arango

isAQLExpression.php

Table of Contents

Functions

isAQLExpression()  : bool
Check if a string looks like an AQL expression that should not be quoted.

Functions

isAQLExpression()

Check if a string looks like an AQL expression that should not be quoted.

isAQLExpression(mixed $value) : bool

Detects:

  • AQL functions: CONCAT(...), DATE_NOW(), etc.
  • Document references: doc.field, user.name, etc.
  • Bind parameters:
Parameters
$value : mixed

The expression value to check

Tags
example

AQL functions

isAQLExpression('CONCAT("a","b")'); // true
isAQLExpression('DATE_NOW()');      // true

Document references

isAQLExpression('doc.name');        // true
isAQLExpression('user.profile');    // true

Bind parameters

isAQLExpression('@userId');         // true
isAQLExpression('@filter.name');    // true

Collection paths

isAQLExpression('users/12345');     // true
isAQLExpression('posts/abc-def');   // true

Regular strings (should be quoted)

isAQLExpression("'hello'");   // true

isAQLExpression('"hello"');   // false
isAQLExpression('hello');     // false
isAQLExpression('user name'); // false
Return values
bool

True if it looks like an AQL expression

On this page

Search results