Method ChangeStream
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
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
optionsChangeStreamStageOptionsThe options.
Returns
- PipelineDefinition<TInput, ChangeStreamDocument<TIntermediate>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.