toString.php
Table of Contents
Functions
- toString() : string
- Converts a value of any type into a string.
Functions
toString()
Converts a value of any type into a string.
toString(mixed $value) : string
This helper wraps the ArangoDB AQL function TO_STRING(), which casts
the provided value to a string. Conversion rules follow AQL semantics:
- Numbers are converted to their string representation.
- Boolean
truebecomes'true',falsebecomes'false'. nullis converted to an empty string''.
Example AQL usage:
TO_STRING(42) // returns "42"
TO_STRING(doc.name) // converts the doc.name field to a string
TO_STRING(true) // returns "true"
TO_STRING(null) // returns ""
Parameters
- $value : mixed
-
The AQL field or expression to convert to a string.
Tags
Return values
string —The formatted AQL expression (e.g., 'TO_STRING(doc.age)').