public DBObject toDBObject ( ) { DBObject args = new BasicDBObject ( "ns" , collectionName ) . append ( "cond" , condition ) . append ( "$reduce" , reduce ) . append ( "initial" , initial ) ; if ( keys != null ) { args . put ( "key" , keys ) ; } if ( keyf != null ) { args . put ( "$keyf" , keyf ) ; } if ( finalize != null ) { args . put ( "finalize" , finalize ) ; } return new BasicDBObject ( "group" , args ) ; }
Turns this group command into the DBObject format of the command .