Method AggregateAsync
AggregateAsync<TResult>(PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)
Runs an aggregation pipeline.
Task<IAsyncCursor<TResult>> AggregateAsync<TResult>(PipelineDefinition<TDocument, TResult> pipeline, AggregateOptions options = null, CancellationToken cancellationToken = default)
Parameters
pipeline
PipelineDefinition<TDocument, TResult>The pipeline.
options
AggregateOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<IAsyncCursor<TResult>>
A Task whose result is a cursor.
Type Parameters
TResult
The type of the result.
AggregateAsync<TResult>(IClientSessionHandle, PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)
Runs an aggregation pipeline.
Task<IAsyncCursor<TResult>> AggregateAsync<TResult>(IClientSessionHandle session, PipelineDefinition<TDocument, TResult> pipeline, AggregateOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSessionHandleThe session.
pipeline
PipelineDefinition<TDocument, TResult>The pipeline.
options
AggregateOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<IAsyncCursor<TResult>>
A Task whose result is a cursor.
Type Parameters
TResult
The type of the result.