From the screenshot you've shared, you're trying out Cosmos DB for MongoDB vCore, $push aggregation operator in $group stage is not supported with vCore yet. The above documentation is for Cosmos DB for MongoDB RU
Accumulator $push not implemented yet. In Cosmos MongoDB
Duy Nguyen (Engineering - Backend)
20
Reputation points
I am using Aggregation in AzureCosmosDB, my collection have many messages and I want to group it by user_id. This is my pipeline:
{"$group": {"_id": "$user_id", "messages": {"$push": "$$ROOT"}}}
But when I ran aggregate, I found an error :
Accumulator $push not implemented yet
I have found the document supported $push accumulator here https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/feature-support-42#accumulator-expressions
So do I use it wrong or I need to call it in another way to use this feature ?
Accepted answer
-
Sajeetharan 2,031 Reputation points Microsoft Employee
2024-04-01T08:46:22.14+00:00