ChangeStreamOps

reactivemongo.api.collections.ChangeStreamOps

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type

Members list

Concise view

Type members

Classlikes

sealed trait WatchBuilder[T]

A builder for the watch collection helper, which allows to consume the collection's ChangeStream.

A builder for the watch collection helper, which allows to consume the collection's ChangeStream.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

final def watch[T](offset: Option[<none>], pipeline: List[<none>], maxAwaitTime: Option[FiniteDuration], fullDocumentStrategy: Option[FullDocumentStrategy])(implicit reader: <none>[T]): WatchBuilder[T]

'''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

Attributes

T

the type into which Change Events are deserialized

fullDocumentStrategy

if set to UpdateLookup, every update change event will be joined with the ''current'' version of the relevant document.

maxAwaitTimeMS

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.

offset

the change stream offset

pipeline

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).

reader

the reader of the resulting change events

Since:

MongoDB 3.6