Docs Menu
Docs Home
///
PHP Library Manual
///

MongoDB\ChangeStream::valid()

MongoDB\ChangeStream::valid()

Returns whether there is a current event in the change stream.

function valid(): boolean

When manually iterating the change stream using

Iteratormethods, this method should be used to determine ifMongoDB\ChangeStream::current() and MongoDB\ChangeStream::key() can be called.

A boolean indicating whether there is a current event in the change stream.

Back

rewind()

On this page