driver-legacy/src/main/com/mongodb/DBCollection.java
@Deprecated
    public DBObject group(final DBObject key, final DBObject cond, final DBObject initial, final String reduce,
                          @Nullable final String finalize) {
        return group(key, cond, initial, reduce, finalize, getReadPreference());
    }
@Deprecated
    public DBObject group(final DBObject key, final DBObject cond, final DBObject initial, final String reduce,
                          @Nullable final String finalize) {
        return group(key, cond, initial, reduce, finalize, getReadPreference());
    }
@ Deprecated public DBObject group ( final DBObject key , final DBObject cond , final DBObject initial , final String reduce , @ Nullable final String finalize ) { return group ( key , cond , initial , reduce , finalize , getReadPreference ( ) ) ; }
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
This is analogous to a {@code SELECT ... GROUP BY} statement in SQL.

@param key      specifies one or more document fields to group
@param cond     specifies the selection criteria to determine which documents in the collection to process
@param initial  initializes the aggregation result document
@param reduce   specifies an $reduce Javascript function, that operates on the documents during the grouping operation
@param finalize specifies a Javascript function that runs each item in the result set before final value will be returned
@return a document with the grouped records as well as the command meta-data
@mongodb.driver.manual reference/command/group/ Group Command
@deprecated The group command was deprecated in MongoDB 3.4
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums . This is analogous to a { @code SELECT ... GROUP BY } statement in SQL .