first.php
Table of Contents
Functions
- first() : string
- Get the first element of an array.
Functions
first()
Get the first element of an array.
first(mixed $anyArray) : string
This helper wraps the ArangoDB AQL function FIRST(anyArray) which returns
the first element of the given array. If the array is empty, it returns null.
Example AQL usage:
FIRST([1, 2, 3]) // returns 1
FIRST(doc.items) // returns first item from doc.items
FIRST([]) // returns null
Parameters
- $anyArray : mixed
-
Array expression to get the first element from.
Tags
Return values
string —The formatted AQL expression.