Generating a list of all used tags:
r.table('posts')('tags').reduce((a, b) => a.setUnion(b))
Grabbing all posts with the 'foo' tag: r.table('posts').filter((doc) => doc('tags').contains('foo')) context.collection.filter(function(doc) {
return doc.city == "Melbourne" && doc.rating > 4.5;
}).map(function(doc) {
return doc.displayName;
});Then the introduction needs some work.
"DocumentDB enables complex ad hoc queries using the SQL dialect"
"Azure DocumentDB offers the following key capabilities and benefits: Ad hoc queries with familiar SQL syntax"
The "Query DocumentDB" article also seems to be focused on that SQL dialect.
I would say it allows flexibility in thinking about your storage and access patterns, which in turn allows flexibility in use. Hopefully without the expense of performance, and integrity.
But there are cases where you need to build the query object programmatically (and dynamically), and I believe it's a bit awkward to do that to obtain an SQL statement. But possibly it's just my personal taste :)