arrayMap.php
Table of Contents
Functions
- arrayMap() : string
- Build an AQL array inline projection `array[* RETURN <expression>]`.
Functions
arrayMap()
Build an AQL array inline projection `array[* RETURN <expression>]`.
arrayMap(string $array, string $expression) : string
This is AQL's array expansion in its projecting form: it maps each element of
$array to $expression (which typically references the loop variable
Clause::CURRENT), yielding a new array. It is the read-only sibling of
arrayFilter() ([* FILTER cond]).
$expression is interpolated verbatim — callers are responsible for building
it from trusted/whitelisted pieces (e.g. CURRENT, an alterExpression()
chain, or a validated sub-field). pluck() is the safe specialization
for a single sub-field (it validates the field name first).
Parameters
- $array : string
-
The array expression to expand (e.g.
doc.tags,@value). - $expression : string
-
The expression returned for each element (e.g.
LOWER(CURRENT)).
Tags
Return values
string —The formatted AQL inline projection.