Table of Contents

Method AggregateToCollectionAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

AggregateToCollectionAsync<TResult>(PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

Task AggregateToCollectionAsync<TResult>(PipelineDefinition<NoPipelineInput, TResult> pipeline, AggregateOptions options = null, CancellationToken cancellationToken = default)

Parameters

pipeline PipelineDefinition<NoPipelineInput, TResult>

The pipeline.

options AggregateOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task.

Type Parameters

TResult

The type of the result.

AggregateToCollectionAsync<TResult>(IClientSessionHandle, PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

Task AggregateToCollectionAsync<TResult>(IClientSessionHandle session, PipelineDefinition<NoPipelineInput, TResult> pipeline, AggregateOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

pipeline PipelineDefinition<NoPipelineInput, TResult>

The pipeline.

options AggregateOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task.

Type Parameters

TResult

The type of the result.