Platforms to show: All Mac Windows Linux Cross-Platform

Back to MongoChangeStreamMBS class.

MongoChangeStreamMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method MongoDB MBS MongoDB Plugin 23.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The private constructor.

MongoChangeStreamMBS.ErrorDocument(byref ReplyJSON as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method MongoDB MBS MongoDB Plugin 23.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks if an error has occurred when creating or iterating over a change stream.

Similar to ErrorDocument in MongoCursorMBS if the error has occurred client-side then the reply will be set to an empty BSON document. If the error occurred server-side, reply is set to the server’s reply document.

Provides the reply from server about the error.

Returns a boolean indicating if there was an error.

MongoChangeStreamMBS.NextChange(byref RecordJSON as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method MongoDB MBS MongoDB Plugin 23.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Iterates the underlying change stream, setting RecordJSON to the next document.
Example

Dim pipeline As String = "{}"
Dim stream As MongoChangeStreamMBS = Collection.Watch(pipeline)

// now do inserts

// and now query changes
Dim changeJSON As String

While stream.NextChange(changeJSON)

MessageBox changeJSON

Wend

This will block for a maximum of maxAwaitTimeMS milliseconds as specified in the options when created, or the default timeout if omitted. Data may be returned before the timeout. If no data is returned this function returns false.

RecordJSON: The location for the resulting document.

This function returns true if a valid bson document was read from the stream. Otherwise, false if there was an error or no document was available.

Raises exception in case of error.

MongoChangeStreamMBS.StreamResumeToken as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method MongoDB MBS MongoDB Plugin 23.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the cached resume token, which may be passed as either the resumeAfter or startAfter option of a watch function to start a new change stream from the same point.

Returns "" if no resume token is available. This is possible if the change stream has not been iterated and neither resumeAfter nor startAfter options were specified in the watch function.

The items on this page are in the following plugins: MBS MongoDB Plugin.


The biggest plugin in space...