This Java statement
Aggregation.group("name").sum("1").as("count")
generates
{"$group" : { "_id": "$name", "count": { "$sum": "$1" } } }
I'd like to specify the $sum value without a reference (removing the $), so it becomes
{ "$sum": "1" }
How to do that ? Thanks.
With my original question, the aim was to use the aggregations via
MongoTemplatefrom Spring, but I found a way to use it withMongoClientmanually specifying the fields like this :