Constructor and Description |
---|
GroupCommand(DBCollection collection,
DBObject keys,
DBObject condition,
DBObject initial,
String reduce,
String finalize)
Creates a new group command.
|
public GroupCommand(DBCollection collection, DBObject keys, DBObject condition, DBObject initial, String reduce, 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 DBObject toDBObject()