toArray.php
Table of Contents
Functions
- toArray() : string
- Converts a value of any type into an array.
Functions
toArray()
Converts a value of any type into an array.
toArray(mixed $value) : string
This helper wraps the ArangoDB AQL function TO_ARRAY(), which casts
the provided value to an array. If the value is already an array, it
is returned as is; otherwise, it will be wrapped in a single-element array.
Example AQL usage:
TO_ARRAY(doc.tags) // returns doc.tags as an array
TO_ARRAY("single") // returns ["single"]
Parameters
- $value : mixed
-
The AQL field or expression to convert to an array.
Tags
Return values
string —The formatted AQL expression (e.g., 'TO_ARRAY(doc.items)').