DocumentDB does not currently support GROUP BY or any other aggregation. This is the second most requested feature and is listed as a "Browse" in DocumentDB DocumentDB .
At the same time, documentdb-lumenize is an aggregation library for DocumentDB written as a stored procedure. You load cube.string as a stored procedure, then call it with the aggregation configuration. This is a bit overkill for this example, but it is perfectly capable of doing what you ask for here. If you pass this to a stored procedure:
{cubeConfig: {groupBy: "name", field: "priority", f: "max"}}
which should do what you want.
Note. Lumenize can do much more than simple, with a simple group function (with a common function (sum, count, min, max, median, p75, etc.), pivot tables and even complex n-dimensional hypercubes with several metrics on cell.
I have never tried loading cube.string from .NET because we are on node.js, but it is sent as a string, not javascript, so you can easily download and send it.
Alternatively, you can write a stored procedure for this simple aggregation.
source share