- Reference >
- Result Classes >
- MongoDB\ChangeStream::next()
MongoDB\ChangeStream::next()
On this page
Definition
-
MongoDB\ChangeStream::next
Advances the change stream and attempts to load the next event.
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 driver level (e.g. connection errors).
See Also
MongoDB\Client::watch()
MongoDB\Collection::watch()
MongoDB\Database::watch()
- Iterator::next()
- Tailable Cursor Iteration
- Change Streams documentation in the MongoDB manual