Method Watch
Watch(IMongoClient, ChangeStreamOptions, CancellationToken)
Watches changes on all collections in all databases.
public static IAsyncCursor<ChangeStreamDocument<BsonDocument>> Watch(this IMongoClient client, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
clientIMongoClientThe client.
optionsChangeStreamOptionsThe options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncCursor<ChangeStreamDocument<BsonDocument>>
A change stream.
Watch(IMongoClient, IClientSessionHandle, ChangeStreamOptions, CancellationToken)
Watches changes on all collections in all databases.
public static IAsyncCursor<ChangeStreamDocument<BsonDocument>> Watch(this IMongoClient client, IClientSessionHandle session, ChangeStreamOptions options = null, CancellationToken cancellationToken = default)
Parameters
clientIMongoClientThe client.
sessionIClientSessionHandleThe session.
optionsChangeStreamOptionsThe options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncCursor<ChangeStreamDocument<BsonDocument>>
A change stream.