Method Merge

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

Merge(IMongoCollection, MergeStageOptions, CancellationToken)

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

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

Parameters

outputCollection IMongoCollection

The output collection.

mergeOptions MergeStageOptions

The merge options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor

A cursor.

Type Parameters

TOutput

The type of output documents.