Click or drag to resize

MongoCollectionBase<TDocument>.Aggregate<TResult> Method (IClientSessionHandle, PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.9.0+32b058abcdf2c7e8d9dd3a676d207b31897eee2e
Syntax
public virtual IAsyncCursor<TResult> Aggregate<TResult>(
	IClientSessionHandle session,
	PipelineDefinition<TDocument, TResult> pipeline,
	AggregateOptions options = null,
	CancellationToken cancellationToken = null
)

Parameters

session
Type: MongoDB.Driver.IClientSessionHandle
The session.
pipeline
Type: MongoDB.Driver.PipelineDefinition<TDocument, TResult>
The pipeline.
options (Optional)
Type: MongoDB.Driver.AggregateOptions
The options.
cancellationToken (Optional)
Type: System.Threading.CancellationToken
The cancellation token.

Type Parameters

TResult
The type of the result.

Return Value

Type: IAsyncCursor<TResult>
A cursor.

Implements

IMongoCollection<TDocument>.Aggregate<TResult>(IClientSessionHandle, PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)
See Also