A builder for the watch
collection helper,
which allows to consume the collection's ChangeStream.
EXPERIMENTAL: Prepares a builder for watching the change stream of this collection.
EXPERIMENTAL: Prepares a builder for watching the change stream of this collection.
Note: The target mongo instance MUST be a replica-set (even in the case of a single node deployement).
import reactivemongo.api.Cursor import reactivemongo.api.bson.BSONDocument import reactivemongo.api.bson.collection.BSONCollection def events(coll: BSONCollection): Cursor[BSONDocument] = coll.watch[BSONDocument]().cursor
the type into which Change Events are deserialized
the change stream offset
The sequence of aggregation stages to apply on events in the stream (see MongoDB documentation for a list of valid stages for a change stream).
if set to UpdateLookup, every update change event will be joined with the current version of the relevant document.
the reader of the resulting change events
MongoDB 3.6