- Reference >
- Result Classes >
- MongoDB\ChangeStream::valid()
MongoDB\ChangeStream::valid()
On this page
Definition
-
MongoDB\ChangeStream::valid
Returns whether there is a current event in the change stream.
When manually iterating the change stream using Iterator methods, this method should be used to determine if
MongoDB\ChangeStream::current()
andMongoDB\ChangeStream::key()
can be called.
Return Values
A boolean indicating whether there is a current event in the change stream.
See Also
MongoDB\Client::watch()
MongoDB\Collection::watch()
MongoDB\Database::watch()
- Iterator::valid()
- Tailable Cursor Iteration
- Change Streams documentation in the MongoDB manual