- Reference >
- Result Classes >
- MongoDB\ChangeStream::getResumeToken()
MongoDB\ChangeStream::getResumeToken()
New in version 1.5.
On this page
Definition
-
MongoDB\ChangeStream::getResumeToken
Returns the cached resume token that will be used to resume the change stream.
Return Values
An array or object, or null
if there is no cached resume token. The return
type will depend on the typeMap
option for the watch()
method used to
create the change stream.
Examples
This example captures the resume token for a change stream after encountering
an invalidate
event and uses it to construct a second change stream using
the startAfter
option.
See Also
MongoDB\Client::watch()
MongoDB\Collection::watch()
MongoDB\Database::watch()
- Resume a Change Stream documentation in the MongoDB manual