#include <mongocxx/v1/change_stream.hpp>
A MongoDB change stream.
- Attention
- This feature is experimental! It is not ready for use!
- See also
-
◆ ~change_stream()
| mongocxx::v1::change_stream::~change_stream |
( |
| ) |
|
Destroy this object.
- Warning
- Invalidates all associated views and iterators.
◆ change_stream() [1/2]
| mongocxx::v1::change_stream::change_stream |
( |
change_stream && | other | ) |
|
|
noexcept |
Move constructor.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ change_stream() [2/2]
| mongocxx::v1::change_stream::change_stream |
( |
change_stream const & | | ) |
|
|
delete |
This class is not copyable.
◆ begin()
| iterator mongocxx::v1::change_stream::begin |
( |
| ) |
|
Return an iterator associated with this change stream.
- Important
- All iterators associated with the same change stream object share the same state.
This function advances the underlying cursor to obtain the first available event document. The underlying cursor is only advanced at most once: consecutive calls to this->begin() do not advance the underlying cursor state. To obtain subsequent available event documents, the resulting iterator must be incremented instead.
- Warning
- Invalidates all views to the current event document and resume token.
- Exceptions
-
◆ end()
Return an end iterator.
- Important
- The end iterator has no associated change stream.
◆ get_resume_token()
Return the resume token for this change stream.
- Returns
- Empty document when not available.
◆ next()
Obtain the next event document.
This function blocks indefinitely: the underlying cursor is repeatedly advanced until an event document is available.
- Note
- Calling this->begin() after this->next() does not advance the underlying cursor state.
- Warning
- Invalidates all views to the current event document and resume token.
- Exceptions
-
◆ operator=() [1/2]
Move constructor.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ operator=() [2/2]
This class is not copyable.
◆ try_next()
Try to obtain the next event document.
This function does not block indefinitely: the underlying cursor is advanced only once. An empty optional is returned when an event document is not available.
- Note
- Calling this->begin() after this->try_next() does not advance the underlying cursor state.
- Warning
- Invalidates all views to the current event document and resume token.
- Exceptions
-
The documentation for this class was generated from the following file: