ChangeEventDelegate
public protocol ChangeEventDelegate : AnyObject
Delegate which is used for subscribing to changes on a MongoCollection.watch()
stream.
-
The stream was opened.
Declaration
Swift
func changeStreamDidOpen(_ changeStream: ChangeStream)
Parameters
changeStream
The
ChangeStream
subscribing to the stream changes. -
The stream has been closed.
Declaration
Swift
func changeStreamDidClose(with error: Error?)
Parameters
error
If an error occurred when closing the stream, an error will be passed.
-
A error has occurred while streaming.
Declaration
Swift
func changeStreamDidReceive(error: Error)
Parameters
error
The streaming error.
-
Invoked when a change event has been received.
Declaration
Swift
func changeStreamDidReceive(changeEvent: AnyBSON?)
Parameters
changeEvent
The change event in BSON format.