AQL Improvements for 2.4
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:
RETURN LENGTH(( FOR doc IN collection FILTER doc.someAttribute == someValue RETURN doc ))
This is quite long and probably unintuitive for people which have used SQL for years.
We therefore now allow using the following alternative version:
Get the latest tutorials, blog posts and news: