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
args
GroupArgsThe 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
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
keyFunction
BsonJavaScriptA JavaScript function that returns the key value to group on.
initial
BsonDocumentInitial value passed to the reduce function for each group.
reduce
BsonJavaScriptA JavaScript function that is called for each matching document in a group.
finalize
BsonJavaScriptA 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
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
keys
IMongoGroupByThe names of the fields to group on.
initial
BsonDocumentInitial value passed to the reduce function for each group.
reduce
BsonJavaScriptA JavaScript function that is called for each matching document in a group.
finalize
BsonJavaScriptA 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
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
key
stringThe name of the field to group on.
initial
BsonDocumentInitial value passed to the reduce function for each group.
reduce
BsonJavaScriptA JavaScript function that is called for each matching document in a group.
finalize
BsonJavaScriptA JavaScript function that is called at the end of the group command.
Returns
- IEnumerable<BsonDocument>
A list of results as BsonDocuments.