sortedUnique.php
Table of Contents
Functions
- sortedUnique() : string
- Sort the elements of an array and remove duplicates.
Functions
sortedUnique()
Sort the elements of an array and remove duplicates.
sortedUnique(mixed $anyArray) : string
This helper wraps the ArangoDB AQL function SORTED_UNIQUE(anyArray) which
returns a new array with all elements sorted in ascending order and duplicates
removed. The original array is not modified.
Example AQL usage:
SORTED_UNIQUE([8, 4, 2, 10, 6, 2, 8, 6, 4]) // returns [2, 4, 6, 8, 10]
SORTED_UNIQUE(["c", "a", "b", "a", "c"]) // returns ["a", "b", "c"]
SORTED_UNIQUE(doc.tags) // sorts and deduplicates tags
Parameters
- $anyArray : mixed
-
Array expression to sort and deduplicate.
Tags
Return values
string —The formatted AQL expression.