Table of Contents

Method MergeAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

MergeAsync<TOutput>(IMongoCollection<TOutput>, MergeStageOptions<TOutput>, CancellationToken)

Appends a merge stage to the pipeline and executes it, and then returns a cursor to read the contents of the output collection.

Task<IAsyncCursor<TOutput>> MergeAsync<TOutput>(IMongoCollection<TOutput> outputCollection, MergeStageOptions<TOutput> mergeOptions = null, CancellationToken cancellationToken = default)

Parameters

outputCollection IMongoCollection<TOutput>

The output collection.

mergeOptions MergeStageOptions<TOutput>

The merge options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<TOutput>>

A cursor.

Type Parameters

TOutput

The type of output documents.