| MongoCollectionGroup Method (IMongoQuery, String, BsonDocument, BsonJavaScript, BsonJavaScript) | 
 Note: This API is now obsolete.
            Runs the group command on this collection.
            
 
    Namespace: 
   MongoDB.Driver
    Assembly:
   MongoDB.Driver.Legacy (in MongoDB.Driver.Legacy.dll) Version: 2.12.2+a4a3888f4fb51bb518b1eb5002effc2d47f2ea6a
 Syntax
Syntax[ObsoleteAttribute("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
)<ObsoleteAttribute("The group command was deprecated in server version 3.4.")>
Public Overridable Function Group ( 
	query As IMongoQuery,
	key As String,
	initial As BsonDocument,
	reduce As BsonJavaScript,
	finalize As BsonJavaScript
) As IEnumerable(Of BsonDocument)[<ObsoleteAttribute("The group command was deprecated in server version 3.4.")>]
abstract Group : 
        query : IMongoQuery * 
        key : string * 
        initial : BsonDocument * 
        reduce : BsonJavaScript * 
        finalize : BsonJavaScript -> IEnumerable<BsonDocument> 
[<ObsoleteAttribute("The group command was deprecated in server version 3.4.")>]
override Group : 
        query : IMongoQuery * 
        key : string * 
        initial : BsonDocument * 
        reduce : BsonJavaScript * 
        finalize : BsonJavaScript -> IEnumerable<BsonDocument> Parameters
- query
- Type: MongoDB.DriverIMongoQuery
 The query (usually a QueryDocument or constructed using the Query builder).
- key
- Type: SystemString
 The name of the field to group on.
- initial
- Type: MongoDB.BsonBsonDocument
 Initial value passed to the reduce function for each group.
- reduce
- Type: MongoDB.BsonBsonJavaScript
 A JavaScript function that is called for each matching document in a group.
- finalize
- Type: MongoDB.BsonBsonJavaScript
 A JavaScript function that is called at the end of the group command.
Return Value
Type: 
IEnumerableBsonDocumentA list of results as BsonDocuments.
 See Also
See Also