Table of Contents

Method Aggregate

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Aggregate<TDocument>(IMongoCollection<TDocument>, AggregateOptions)

Begins a fluent aggregation interface.

public static IAggregateFluent<TDocument> Aggregate<TDocument>(this IMongoCollection<TDocument> collection, AggregateOptions options = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

options AggregateOptions

The options.

Returns

IAggregateFluent<TDocument>

A fluent aggregate interface.

Type Parameters

TDocument

The type of the document.

Aggregate<TDocument>(IMongoCollection<TDocument>, IClientSessionHandle, AggregateOptions)

Begins a fluent aggregation interface.

public static IAggregateFluent<TDocument> Aggregate<TDocument>(this IMongoCollection<TDocument> collection, IClientSessionHandle session, AggregateOptions options = null)

Parameters

collection IMongoCollection<TDocument>

The collection.

session IClientSessionHandle

The session.

options AggregateOptions

The options.

Returns

IAggregateFluent<TDocument>

A fluent aggregate interface.

Type Parameters

TDocument

The type of the document.