A builder for the watch
collection helper, which allows to consume the collection's ChangeStream.
Prepares a builder for watching the changeStream of this collection https://docs.mongodb.com/manual/changeStreams (since MongoDB 3.6).
Prepares a builder for watching the changeStream of this collection https://docs.mongodb.com/manual/changeStreams (since MongoDB 3.6).
Note: the target mongo instance MUST be a replica-set (even in the case of a single node deployement).
the type into which Change Events are deserialized
The id of the last known Change Event, if any. The stream will resume just after that event.
The operation time before which all Change Events are known. Must be in the time range of the oplog. (since MongoDB 4.0)
A sequence of aggregation stages to apply on events in the stream (see MongoDB documentation for a list of valid stages for a change stream).
The maximum amount of time in milliseconds the server waits for new data changes before returning an empty batch. In practice, this parameter controls the duration of the long-polling behavior of the cursor.
if set to UpdateLookup, every update change event will be joined with the *current* version of the relevant document.
a reader of the resulting Change Events