Package com.mongodb

Class GroupCommand


  • Deprecated. 
    the group command was deprecated in MongoDB 3.4

    @Deprecated
    public class GroupCommand
    extends java.lang.Object
    This class groups the argument for a group operation and can build the underlying command object
    MongoDB documentation
    Group
    • Constructor Summary

      Constructors 
      Constructor Description
      GroupCommand​(DBCollection collection, com.mongodb.DBObject keys, com.mongodb.DBObject condition, com.mongodb.DBObject initial, java.lang.String reduce, java.lang.String finalize)
      Deprecated. 
      Creates a new group command.
      GroupCommand​(DBCollection collection, com.mongodb.DBObject keys, com.mongodb.DBObject condition, com.mongodb.DBObject initial, java.lang.String reduce, java.lang.String finalize, com.mongodb.client.model.Collation collation)
      Deprecated. 
      Creates a new group command.
      GroupCommand​(DBCollection collection, java.lang.String keyf, com.mongodb.DBObject condition, com.mongodb.DBObject initial, java.lang.String reduce, java.lang.String finalize)
      Deprecated. 
      Creates a new group command.
      GroupCommand​(DBCollection collection, java.lang.String keyf, com.mongodb.DBObject condition, com.mongodb.DBObject initial, java.lang.String reduce, java.lang.String finalize, com.mongodb.client.model.Collation collation)
      Deprecated. 
      Creates a new group command.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      com.mongodb.DBObject toDBObject​()
      Deprecated. 
      Turns this group command into the DBObject format of the command.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GroupCommand

        public GroupCommand​(DBCollection collection,
                            com.mongodb.DBObject keys,
                            com.mongodb.DBObject condition,
                            com.mongodb.DBObject initial,
                            java.lang.String reduce,
                            @Nullable
                            java.lang.String finalize)
        Deprecated. 
        Creates a new group command.
        Parameters:
        collection - the collection from which to perform the group by operation.
        keys - the field or fields to group.
        condition - optional - a filter to determine which documents in the collection to process.
        initial - the initial state of the aggregation result document.
        reduce - a JavaScript aggregation function that operates on the documents during the grouping operation.
        finalize - optional - a JavaScript function that runs each item in the result set before group returns the final value.
      • GroupCommand

        public GroupCommand​(DBCollection collection,
                            com.mongodb.DBObject keys,
                            com.mongodb.DBObject condition,
                            com.mongodb.DBObject initial,
                            java.lang.String reduce,
                            @Nullable
                            java.lang.String finalize,
                            @Nullable
                            com.mongodb.client.model.Collation collation)
        Deprecated. 
        Creates a new group command.
        Parameters:
        collection - the collection from which to perform the group by operation.
        keys - the field or fields to group.
        condition - optional - a filter to determine which documents in the collection to process.
        initial - the initial state of the aggregation result document.
        reduce - a JavaScript aggregation function that operates on the documents during the grouping operation.
        finalize - optional - a JavaScript function that runs each item in the result set before group returns the final value.
        collation - optional - the collation options
        Since:
        3.4
      • GroupCommand

        public GroupCommand​(DBCollection collection,
                            java.lang.String keyf,
                            com.mongodb.DBObject condition,
                            com.mongodb.DBObject initial,
                            java.lang.String reduce,
                            java.lang.String finalize)
        Deprecated. 
        Creates a new group command.
        Parameters:
        collection - the collection from which to perform the group by operation.
        keyf - the function that creates a "key object" for use as the grouping key
        condition - optional - a filter to determine which documents in the collection to process.
        initial - the initial state of the aggregation result document.
        reduce - a JavaScript aggregation function that operates on the documents during the grouping operation.
        finalize - optional - a JavaScript function that runs each item in the result set before group returns the final value.
        Since:
        3.1
      • GroupCommand

        public GroupCommand​(DBCollection collection,
                            java.lang.String keyf,
                            com.mongodb.DBObject condition,
                            com.mongodb.DBObject initial,
                            java.lang.String reduce,
                            @Nullable
                            java.lang.String finalize,
                            @Nullable
                            com.mongodb.client.model.Collation collation)
        Deprecated. 
        Creates a new group command.
        Parameters:
        collection - the collection from which to perform the group by operation.
        keyf - the function that creates a "key object" for use as the grouping key
        condition - optional - a filter to determine which documents in the collection to process.
        initial - the initial state of the aggregation result document.
        reduce - a JavaScript aggregation function that operates on the documents during the grouping operation.
        finalize - optional - a JavaScript function that runs each item in the result set before group returns the final value.
        collation - optional - the collation options
        Since:
        3.4
    • Method Detail

      • toDBObject

        public com.mongodb.DBObject toDBObject​()
        Deprecated. 
        Turns this group command into the DBObject format of the command.
        Returns:
        a DBObject containing the group command as a MongoDB document