aqlDocument.php
Table of Contents
Functions
- aqlDocument() : string
- Generate a document expression for ArangoDB AQL.
Functions
aqlDocument()
Generate a document expression for ArangoDB AQL.
aqlDocument([object|array<string|int, mixed>|string|null $keyValues = [] ][, array<string|int, mixed> $options = [] ]) : string
Accepts:
- associative arrays: ['key' => value, ...]
- indexed arrays of [key, value] pairs: [['key', value], ...]
- objects: converted to associative arrays
- strings: returned as-is inside braces
- null: returns '}'
Options can be passed as an associative array:
- 'useSpace' : bool, add spaces around braces and after commas
- 'rawKeys' : array, KEYS whose value is emitted raw (not quoted, not converted). The key itself is still escaped when it is not an identifier. Applies to the top level only.
- 'rawValues' : array, VALUES (exact strings) emitted raw wherever they appear, nested documents included. It never matches a key : to keep the value of a given key raw, use 'rawKeys'.
A string value is emitted raw when isAQLExpression() recognizes it (a known
function call, doc.field, @bind, collection/key) ; anything else is quoted.
Compound expressions and parenthesized subqueries are NOT recognized : declare
them with 'rawKeys' (or 'rawValues').
Parameters
- $keyValues : object|array<string|int, mixed>|string|null = []
-
Array of key-value pairs, associative array, object, string, or null
- $options : array<string|int, mixed> = []
-
Optional settings: ['useSpace'=>bool, 'rawValues'=>array, 'rawKeys'=>array]
Tags
Return values
string —JS-like object expression for AQL