Method WatchAsync
WatchAsync<TResult>(PipelineDefinition<ChangeStreamDocument<TDocument>, TResult>, ChangeStreamOptions, CancellationToken)
Watches changes on the collection.
Task<IChangeStreamCursor<TResult>> WatchAsync<TResult>(PipelineDefinition<ChangeStreamDocument<TDocument>, TResult> pipeline, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
pipeline
PipelineDefinition<ChangeStreamDocument<TDocument>, TResult>The pipeline.
options
ChangeStreamOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<IChangeStreamCursor<TResult>>
A change stream.
Type Parameters
TResult
The type of the result.
WatchAsync<TResult>(IClientSessionHandle, PipelineDefinition<ChangeStreamDocument<TDocument>, TResult>, ChangeStreamOptions, CancellationToken)
Watches changes on the collection.
Task<IChangeStreamCursor<TResult>> WatchAsync<TResult>(IClientSessionHandle session, PipelineDefinition<ChangeStreamDocument<TDocument>, TResult> pipeline, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSessionHandleThe session.
pipeline
PipelineDefinition<ChangeStreamDocument<TDocument>, TResult>The pipeline.
options
ChangeStreamOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<IChangeStreamCursor<TResult>>
A change stream.
Type Parameters
TResult
The type of the result.