While on a retreat in Belgium, we found some spare time to work on improvements for AQL. These will be shipped with ArangoDB version 2.4, and are already available in the devel version for testing from now on.
Here’s a short overview of the improvements:
Collect with count
A common use case in query languages is to count the number of documents returned by a query. The AQL solution for this has been to use the
LENGTH function and a subquery:
FOR doc IN collection
FILTER doc.someAttribute == someValue
This is quite long and probably unintuitive for people which have used SQL for years.
We therefore now allow using the following alternative version: