Table of Contents

Method Aggregate

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Aggregate<TResult>(PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

IAsyncCursor<TResult> Aggregate<TResult>(PipelineDefinition<TDocument, TResult> pipeline, AggregateOptions options = null, CancellationToken cancellationToken = default)

Parameters

pipeline PipelineDefinition<TDocument, TResult>

The pipeline.

options AggregateOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<TResult>

A cursor.

Type Parameters

TResult

The type of the result.

Aggregate<TResult>(IClientSessionHandle, PipelineDefinition<TDocument, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

IAsyncCursor<TResult> Aggregate<TResult>(IClientSessionHandle session, PipelineDefinition<TDocument, TResult> pipeline, AggregateOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

pipeline PipelineDefinition<TDocument, TResult>

The pipeline.

options AggregateOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<TResult>

A cursor.

Type Parameters

TResult

The type of the result.