I am working on a existing java based application which is using MongoDB
In one of the class I saw a mongo db group as shown below
BasicDBList result = (BasicDBList) coll.group(key, cond, initial, reduce);
Where key, cond, initial are three different BasicDBObject‘s and reduce is a function in the form of a String
My question is can we see the query that is formed ??
If you have the source code for the MongoDB Java driver, you can look at
com.mongodb.GroupCommandto see how this query is built up, it looks something like this:What this translates to is a group command (http://docs.mongodb.org/manual/reference/command/group/) which looks like this: