Method AggregateToCollection
AggregateToCollection<TResult>(PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)
Runs an aggregation pipeline whose results are written to a collection.
public virtual void AggregateToCollection<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.
Type Parameters
TResult
The type of the result.
AggregateToCollection<TResult>(IClientSessionHandle, PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)
Runs an aggregation pipeline whose results are written to a collection.
public virtual void AggregateToCollection<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.
Type Parameters
TResult
The type of the result.