value.php
Table of Contents
Functions
- value() : string
- Extract a value from a document at the specified path.
Functions
value()
Extract a value from a document at the specified path.
value(string $document, array<string|int, mixed> $path) : string
This helper wraps the ArangoDB AQL function VALUE(document, path) which extracts
a value from a document using a path array. The path can contain strings (object keys)
and integers (array indices) to navigate through nested structures.
Example AQL usage:
VALUE(doc, ["author", "name"]) // extracts doc.author.name
VALUE(doc, ["tags", 0]) // extracts first element of doc.tags array
VALUE(doc, ["metadata", "version"]) // extracts doc.metadata.version
Parameters
- $document : string
-
The document variable or expression to extract value from.
- $path : array<string|int, mixed>
-
An array of strings and numbers describing the attribute path. Use strings for object keys and integers for array indices.
Tags
Return values
string —The formatted AQL expression.