Alternative to the group for db space
As Cosmos_DB says this:
SQL aggregation capabilities are limited to COUNT, SUM, MIN, MAX, AVG functions. There is no support for GROUP BY or other aggregation functions found on database systems. However, stored procedures can be used to implement aggregation capabilities in a database.
Can I efficiently achieve this in a space stored procedure?
For .NET and Node.js
Larry McCherone provided an excellent package documentdb-lumenize that supports aggregations (Group-by, Pivot-table, and N-cube) and time series transformations as stored procedures in DocumentDB.
Also, for Python and Scala, you can refer to azure-cosmosdb-spark .
source to share
Grouping by is now supported in the Cosmos db SQL API. You need SDK version 3.3 or higher
Azure Cosmos DB currently supports GROUP BY in the .NET SDK 3.3 or later. Support for other languages ββin the SDK and Azure Portal is not currently supported. available but planned.
https://docs.microsoft.com/en-gb/azure/cosmos-db/sql-query-group-by
source to share