tldr; ArangoDB supports indexed nested object arrays, but without some planning and profiling, it may not use your indices.
Document Databases are great, but querying nested object arrays always adds some complexity. In DynamoDB, it is basically impossible without doing a full scan or flattening the data structure. ElasticSearch has good support for nested documents or indexes keys.
ArangoDB supports arrays of nested objects similarly to ElasticSearch. ArangoDB has an excellent profiler, making it simple to examine query execution. After some experimenting, I was able to optimize queries of arrays of nested objects.
This is a sample query that filters by the nested object. This will NOT use the index.
This is a variation of the same query. This WILL use the index.
Note: if you want to return the specific child object, you need to join the child entity and you need to filter on the indexed child values – you double the filters. In effect, this finds the document based on the index, then scans through each of the child objects to find the match. The double filters are only required if you are concerned about returning the specific child object.
While Query 1 seems more natural, with a real dataset, a similar query took 5 s. Query 2 on the same dataset took 30 ms.
ArangoDB supports indexed nested object arrays, but without some planning and profiling, it may not use your indices.
Especially when learning a new database like ArangoDB, use the Profiling tools and ensure that the execution plan meets your expectations.
Thanks for reading! I'd love to hear your thoughts or questions.