Enhanced AQL in ArangoDB 2.4: Boost Query Performance
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:
2 Comments
Leave a Comment
Get the latest tutorials, blog posts and news:
Nice, this was a “missing” feature.
Good to see that ArangoDB is getting better and better, week by week!
Is “WITH COUNT INTO …” or “INTO … COUNT” the final syntax?