MongoCollectionBaseTDocumentWatchTResult Method (IClientSessionHandle, PipelineDefinitionChangeStreamDocumentTDocument, TResult, ChangeStreamOptions, CancellationToken) |
Watches changes on the collection.
Namespace:
MongoDB.Driver
Assembly:
MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.20.0+ee01960089f28ea1b501690df5fc9f6318a70242
Syntax public virtual IChangeStreamCursor<TResult> Watch<TResult>(
IClientSessionHandle session,
PipelineDefinition<ChangeStreamDocument<TDocument>, TResult> pipeline,
ChangeStreamOptions options = null,
CancellationToken cancellationToken = null
)
Public Overridable Function Watch(Of TResult) (
session As IClientSessionHandle,
pipeline As PipelineDefinition(Of ChangeStreamDocument(Of TDocument), TResult),
Optional options As ChangeStreamOptions = Nothing,
Optional cancellationToken As CancellationToken = Nothing
) As IChangeStreamCursor(Of TResult)
abstract Watch :
session : IClientSessionHandle *
pipeline : PipelineDefinition<ChangeStreamDocument<'TDocument>, 'TResult> *
?options : ChangeStreamOptions *
?cancellationToken : CancellationToken
(* Defaults:
let _options = defaultArg options null
let _cancellationToken = defaultArg cancellationToken null
*)
-> IChangeStreamCursor<'TResult>
override Watch :
session : IClientSessionHandle *
pipeline : PipelineDefinition<ChangeStreamDocument<'TDocument>, 'TResult> *
?options : ChangeStreamOptions *
?cancellationToken : CancellationToken
(* Defaults:
let _options = defaultArg options null
let _cancellationToken = defaultArg cancellationToken null
*)
-> IChangeStreamCursor<'TResult>
Parameters
- session
- Type: MongoDB.DriverIClientSessionHandle
The session. - pipeline
- Type: MongoDB.DriverPipelineDefinitionChangeStreamDocumentTDocument, TResult
The pipeline. - options (Optional)
- Type: MongoDB.DriverChangeStreamOptions
The options. - cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
The cancellation token.
Type Parameters
- TResult
- The type of the result.
Return Value
Type:
IChangeStreamCursorTResult
A change stream.
Implements
IMongoCollectionTDocumentWatchTResult(IClientSessionHandle, PipelineDefinitionChangeStreamDocumentTDocument, TResult, ChangeStreamOptions, CancellationToken)See Also