Queries without collections
AQL queries typically access one or more collections to read from documents or to modify them. Queries don’t necessarily have to involve collections however. Below are a few examples of that.
Following is a query that returns a string value. The result string is contained in an array because the result of every valid query is an array:
RETURN "this will be returned"
[
"this will be returned"
]
You may use variables, call functions and return arbitrarily structured results:
Language constructs such as the FOR loop can be used too. Below query creates the Cartesian product of two arrays and concatenates the value pairs: