MongoDB C++ Driver
mongocxx-3.10.2
|
Class representing a MongoDB change stream iterator. More...
#include <change_stream.hpp>
Public Member Functions | |
iterator () | |
Default-construct an iterator. More... | |
const bsoncxx::v_noabi::document::view & | operator* () const |
Dereferences the view for the document currently being pointed to. More... | |
const bsoncxx::v_noabi::document::view * | operator-> () const |
Accesses a member of the dereferenced document currently being pointed to. More... | |
iterator & | operator++ () |
Pre-increments the iterator to move to the next document. More... | |
void | operator++ (int) |
Post-increments the iterator to move to the next document. More... | |
Friends | |
bool | operator== (const change_stream::iterator &, const change_stream::iterator &) noexcept |
Compare two iterators for (in)-equality. More... | |
bool | operator!= (const change_stream::iterator &, const change_stream::iterator &) noexcept |
Compare two iterators for (in)-equality. More... | |
Class representing a MongoDB change stream iterator.
mongocxx::v_noabi::change_stream::iterator::iterator | ( | ) |
Default-construct an iterator.
Default-constucted iterators can be compared (all default-constructed iterators are ==), assigned, and copied.
const bsoncxx::v_noabi::document::view& mongocxx::v_noabi::change_stream::iterator::operator* | ( | ) | const |
Dereferences the view for the document currently being pointed to.
The returned document::view is valid until the iterator is incremented. The value may be copied to extend its lifetime.
iterator& mongocxx::v_noabi::change_stream::iterator::operator++ | ( | ) |
Pre-increments the iterator to move to the next document.
change_stream::begin() and increment operators may block if the current batch of documents is exhausted. They will not return until a notification is available, the max_await_time (from the options::change_stream) milliseconds have elapsed, or a server error is encountered.
If no notification is available, callers may call change_stream::begin() to check for more notifications.
mongocxx::v_noabi::query_exception | if the query failed |
void mongocxx::v_noabi::change_stream::iterator::operator++ | ( | int | ) |
Post-increments the iterator to move to the next document.
change_stream::begin() and increment operators may block if the current batch of documents is exhausted. They will not return until a notification is available, the max_await_time (from the options::change_stream) milliseconds have elapsed, or a server error is encountered.
If no notification is available, callers may call change_stream::begin() to check for more notifications.
mongocxx::v_noabi::query_exception | if the query failed |
const bsoncxx::v_noabi::document::view* mongocxx::v_noabi::change_stream::iterator::operator-> | ( | ) | const |
Accesses a member of the dereferenced document currently being pointed to.
The returned document::view is valid until the iterator is incremented. The value may be copied to extend its lifetime.
|
friend |
Compare two iterators for (in)-equality.
Iterators compare equal if they point to the same underlying change_stream or if both are exhausted.
|
friend |
Compare two iterators for (in)-equality.
Iterators compare equal if they point to the same underlying change_stream or if both are exhausted.