#include <mongocxx/v1/write_concern.hpp>
Options related to a MongoDB Write Concern.
Supported fields include:
- See also
-
- Attention
- This feature is experimental! It is not ready for use!
◆ level
The write concern level.
- See also
-
- Attention
- This feature is experimental! It is not ready for use!
◆ ~write_concern()
| mongocxx::v1::write_concern::~write_concern |
( |
| ) |
|
◆ write_concern() [1/3]
| mongocxx::v1::write_concern::write_concern |
( |
write_concern && | other | ) |
|
|
noexcept |
Move constructor.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ write_concern() [2/3]
| mongocxx::v1::write_concern::write_concern |
( |
write_concern const & | other | ) |
|
◆ write_concern() [3/3]
| mongocxx::v1::write_concern::write_concern |
( |
| ) |
|
Default initialization.
- Postconditions:
- All supported fields are "unset" or zero-initialized.
◆ acknowledge_level() [1/2]
| level mongocxx::v1::write_concern::acknowledge_level |
( |
| ) |
const |
Return the current "w" field as an acknowledgement level.
- Returns
-
◆ acknowledge_level() [2/2]
Set the "w" field as to acknowledgement level.
- Parameters
-
| v | One of:
- k_default
- k_majority
- k_unacknowledged
- k_acknowledged
|
◆ is_acknowledged()
| bool mongocxx::v1::write_concern::is_acknowledged |
( |
| ) |
const |
Return true when this write concern requires acknowledgement.
◆ journal() [1/2]
Return the current "j" field.
◆ journal() [2/2]
◆ majority() [1/2]
Equivalent to this->acknowledge_level(level::k_majority).
◆ majority() [2/2]
| write_concern & mongocxx::v1::write_concern::majority |
( |
std::chrono::milliseconds | v | ) |
|
|
inline |
Equivalent to this->acknowledge_level(k_majority).timeout(timeout).
◆ nodes() [1/2]
◆ nodes() [2/2]
| write_concern & mongocxx::v1::write_concern::nodes |
( |
std::int32_t | v | ) |
|
Set the "w" field to an integer.
- Parameters
-
| v |
- 0 is equivalent to this->acknowledge_level(k_unacknowledged).
- 1 is equivalent to this->acknowledge_level(k_acknowledged).
|
◆ operator=() [1/2]
Move assignment.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ operator=() [2/2]
◆ tag() [1/2]
◆ tag() [2/2]
Set the "w" field to a custom write concern name.
◆ timeout() [1/2]
| std::chrono::milliseconds mongocxx::v1::write_concern::timeout |
( |
| ) |
const |
Return the current "wtimeout" field.
- Note
- 0 is equivalent to "unset".
◆ timeout() [2/2]
| write_concern & mongocxx::v1::write_concern::timeout |
( |
std::chrono::milliseconds | v | ) |
|
Set the "wtimeout" field.
- Note
- 0 is equivalent to "unset".
◆ to_document()
Return this write concern option as a document.
- Preconditions:
-
◆ operator!=
Compare equal when all supported fields compare equal.
◆ operator==
Compare equal when all supported fields compare equal.
The documentation for this class was generated from the following file: