sorted.php
Table of Contents
Functions
- sorted() : string
- Sort the elements of an array.
Functions
sorted()
Sort the elements of an array.
sorted(mixed $anyArray) : string
This helper wraps the ArangoDB AQL function SORTED(anyArray) which returns
a new array with all elements sorted in ascending order. The original array
is not modified. Elements are sorted using ArangoDB's default comparison rules.
Example AQL usage:
SORTED([4, 1, 8, 2, 3]) // returns [1, 2, 3, 4, 8]
SORTED(["c", "a", "b"]) // returns ["a", "b", "c"]
SORTED(doc.numbers) // sorts the numbers array
Parameters
- $anyArray : mixed
-
Array expression to sort.
Tags
Return values
string —The formatted AQL expression.