Table of Contents

Method ChangeStream

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ChangeStream<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, ChangeStreamStageOptions)

Appends a $changeStream stage to the pipeline. Normally you would prefer to use the Watch method of IMongoCollection<TDocument>. Only use this method if subsequent stages project away the resume token (the _id) or you don't want the resulting cursor to automatically resume.

public static PipelineDefinition<TInput, ChangeStreamDocument<TIntermediate>> ChangeStream<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, ChangeStreamStageOptions options = null)

Parameters

pipeline PipelineDefinition<TInput, TIntermediate>

The pipeline.

options ChangeStreamStageOptions

The options.

Returns

PipelineDefinition<TInput, ChangeStreamDocument<TIntermediate>>

A new pipeline with an additional stage.

Type Parameters

TInput

The type of the input documents.

TIntermediate

The type of the intermediate documents.