public class GroupCommand
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Collation |
collation |
private java.lang.String |
collectionName |
private DBObject |
condition |
private java.lang.String |
finalize |
private DBObject |
initial |
private java.lang.String |
keyf |
private DBObject |
keys |
private java.lang.String |
reduce |
Constructor and Description |
---|
GroupCommand(DBCollection collection,
DBObject keys,
DBObject condition,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize)
Creates a new group command.
|
GroupCommand(DBCollection collection,
DBObject keys,
DBObject condition,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize,
Collation collation)
Creates a new group command.
|
GroupCommand(DBCollection collection,
java.lang.String keyf,
DBObject condition,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize)
Creates a new group command.
|
GroupCommand(DBCollection collection,
java.lang.String keyf,
DBObject condition,
DBObject initial,
java.lang.String reduce,
java.lang.String finalize,
Collation collation)
Creates a new group command.
|
Modifier and Type | Method and Description |
---|---|
DBObject |
toDBObject()
Turns this group command into the DBObject format of the command.
|
(package private) GroupOperation<DBObject> |
toOperation(MongoNamespace namespace,
DBObjectCodec codec) |
private final java.lang.String collectionName
private final DBObject keys
private final java.lang.String keyf
private final DBObject condition
private final DBObject initial
private final java.lang.String reduce
private final java.lang.String finalize
private final Collation collation
public GroupCommand(DBCollection collection, DBObject keys, DBObject condition, DBObject initial, java.lang.String reduce, java.lang.String finalize)
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.public GroupCommand(DBCollection collection, DBObject keys, DBObject condition, DBObject initial, java.lang.String reduce, java.lang.String finalize, Collation collation)
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 optionspublic GroupCommand(DBCollection collection, java.lang.String keyf, DBObject condition, DBObject initial, java.lang.String reduce, java.lang.String finalize)
collection
- the collection from which to perform the group by operation.keyf
- the function that creates a "key object" for use as the grouping keycondition
- 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.public GroupCommand(DBCollection collection, java.lang.String keyf, DBObject condition, DBObject initial, java.lang.String reduce, java.lang.String finalize, Collation collation)
collection
- the collection from which to perform the group by operation.keyf
- the function that creates a "key object" for use as the grouping keycondition
- 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 optionspublic DBObject toDBObject()
GroupOperation<DBObject> toOperation(MongoNamespace namespace, DBObjectCodec codec)