Method Aggregate

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

Aggregate(IMongoCollection, AggregateOptions)

Begins a fluent aggregation interface.

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

Parameters

collection IMongoCollection

The collection.

options AggregateOptions

The options.

Returns

IAggregateFluent

A fluent aggregate interface.

Type Parameters

TDocument

The type of the document.

Aggregate(IMongoCollection, 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

The collection.

session IClientSessionHandle

The session.

options AggregateOptions

The options.

Returns

IAggregateFluent

A fluent aggregate interface.

Type Parameters

TDocument

The type of the document.