MongoListener class

A listener that reacts to MongoDB change events.

Each listener has a unique id, a list of events it listens to, and optionally a _callback and a stream to emit changes.

Constructors

MongoListener({List<String> events = const [], void callback(MongoChange change)?, required StreamController<MongoChange> controller})
Creates a MongoListener instance.

Properties

cancel ↔ void Function()
Optional function to remove/unsubscribe this listener.
getter/setter pair
events List<String>
List of event names this listener is interested in.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for the listener (generated with Uuid.long).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<MongoChange>
Stream that emits changes received by this listener.
no setter

Methods

call(MongoChange change) → void
Emits a MongoChange to the stream and invokes the callback if defined.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited