Method Group
Group(GroupArgs)
Runs the group command on this collection.
[Obsolete("The group command was deprecated in server version 3.4.")]
public virtual IEnumerable<BsonDocument> Group(GroupArgs args)
Parameters
argsGroupArgsThe args.
Returns
- IEnumerable<BsonDocument>
A list of results as BsonDocuments.
Group(IMongoQuery, BsonJavaScript, BsonDocument, BsonJavaScript, BsonJavaScript)
Runs the group command on this collection.
[Obsolete("The group command was deprecated in server version 3.4.")]
public virtual IEnumerable<BsonDocument> Group(IMongoQuery query, BsonJavaScript keyFunction, BsonDocument initial, BsonJavaScript reduce, BsonJavaScript finalize)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
keyFunctionBsonJavaScriptA JavaScript function that returns the key value to group on.
initialBsonDocumentInitial value passed to the reduce function for each group.
reduceBsonJavaScriptA JavaScript function that is called for each matching document in a group.
finalizeBsonJavaScriptA JavaScript function that is called at the end of the group command.
Returns
- IEnumerable<BsonDocument>
A list of results as BsonDocuments.
Group(IMongoQuery, IMongoGroupBy, BsonDocument, BsonJavaScript, BsonJavaScript)
Runs the group command on this collection.
[Obsolete("The group command was deprecated in server version 3.4.")]
public virtual IEnumerable<BsonDocument> Group(IMongoQuery query, IMongoGroupBy keys, BsonDocument initial, BsonJavaScript reduce, BsonJavaScript finalize)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
keysIMongoGroupByThe names of the fields to group on.
initialBsonDocumentInitial value passed to the reduce function for each group.
reduceBsonJavaScriptA JavaScript function that is called for each matching document in a group.
finalizeBsonJavaScriptA JavaScript function that is called at the end of the group command.
Returns
- IEnumerable<BsonDocument>
A list of results as BsonDocuments.
Group(IMongoQuery, string, BsonDocument, BsonJavaScript, BsonJavaScript)
Runs the group command on this collection.
[Obsolete("The group command was deprecated in server version 3.4.")]
public virtual IEnumerable<BsonDocument> Group(IMongoQuery query, string key, BsonDocument initial, BsonJavaScript reduce, BsonJavaScript finalize)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
keystringThe name of the field to group on.
initialBsonDocumentInitial value passed to the reduce function for each group.
reduceBsonJavaScriptA JavaScript function that is called for each matching document in a group.
finalizeBsonJavaScriptA JavaScript function that is called at the end of the group command.
Returns
- IEnumerable<BsonDocument>
A list of results as BsonDocuments.