Docs Menu

Docs HomePHP Library Manual

MongoDB\ChangeStream::valid()

On this page

  • Definition
  • Return Values
  • See Also
MongoDB\ChangeStream::valid()

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

function valid(): boolean

When manually iterating the change stream using Iterator methods, this method should be used to determine if MongoDB\ChangeStream::current() and MongoDB\ChangeStream::key() can be called.

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

←  MongoDB\ChangeStream::rewind()MongoDB\MapReduceResult Class →