Click or drag to resize

IMongoCollection<TDocument>.AggregateAsync<TResult> Method (IClientSessionHandle, PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.8.0+cc573f3e1f48f39162b4b680e921a623e127e8fa
Syntax
Task<IAsyncCursor<TResult>> AggregateAsync<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: Task<IAsyncCursor<TResult>>
A Task whose result is a cursor.
See Also