Click or drag to resize

IMongoDatabase.AggregateAsync<TResult> Method (IClientSessionHandle, PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.14.0+2b37a1fe1cbdbe1a020b52b77f1197b6d77575e7
Syntax
Task<IAsyncCursor<TResult>> AggregateAsync<TResult>(
	IClientSessionHandle session,
	PipelineDefinition<NoPipelineInput, TResult> pipeline,
	AggregateOptions options = null,
	CancellationToken cancellationToken = default
)

Parameters

session
Type: MongoDB.Driver.IClientSessionHandle
The session.
pipeline
Type: MongoDB.Driver.PipelineDefinition<NoPipelineInput, 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