Hello,
There is not enough information available on documentation about “GROUP By” in JAVA language.You should provide some better example and brief explanation about all Aggregation operation so that everyone can understand easily.
We can use GROUP by with DBObject also but in GROUPOPERATION method, It is fatigue task to do as it is not easily understandable.
I hope, You may see this request and take immediate action.
Finally, since I have projects in Java, some in nodejs and use the shell on daily basis, I keep my aggregation pipelines in json, even in Java where I do not use the aggregation builder classes.
As of Java driver v3.9 GroupOperation is deprecated.
Compass’s Aggregation Pipeline Builder has Export Pipeline to Specific Language feature, and this allows the built pipeline to be converted to corresponding Java code.