Click or drag to resize

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

Runs an aggregation pipeline whose results are written to a collection.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.18.0+554c799eb1ec8dd732f16c739387f6664df1ba7a
Syntax
Task AggregateToCollectionAsync<TResult>(
	PipelineDefinition<TDocument, TResult> pipeline,
	AggregateOptions options = null,
	CancellationToken cancellationToken = default
)

Parameters

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
A Task.
See Also