You are viewing an offline version of MongoDB documentation. Some page features might be unavailable. To view the latest version of the page or use interactive features, visit the live page.
MongoDB\ChangeStream::next()
Definition
MongoDB\ChangeStream::next()Advances the change stream and attempts to load the next event.
function next(): void Note
Advancing the change stream does not guarantee that there will be a current event to access. You should still call
MongoDB\ChangeStream::valid()to check for a current event at each step of iteration.
Errors/Exceptions
MongoDB\Driver\Exception\RuntimeException for other errors at the extension level (e.g. connection errors).
See Also
Change Streams documentation in the MongoDB manual