#include <userver/storages/mongo/options.hpp>
Write concern.
Definition at line 80 of file options.hpp.
Public Types | |
enum | Level { kMajority , kUnacknowledged } |
Public Member Functions | |
WriteConcern (Level level) | |
Creates a write concern with the special level. | |
WriteConcern (size_t nodes_count) | |
Creates a write concern waiting for propagation to nodes_count RS nodes. | |
WriteConcern (std::string tag) | |
Creates a write concern defined in RS config. | |
bool | IsMajority () const |
size_t | NodesCount () const |
const std::string & | Tag () const |
std::optional< bool > | Journal () const |
const std::chrono::milliseconds & | Timeout () const |
WriteConcern & | SetTimeout (std::chrono::milliseconds timeout) |
Sets write concern timeout, 0 means no timeout. | |
WriteConcern & | SetJournal (bool value) |
Sets whether to wait for on-disk journal commit. | |
Static Public Attributes | |
static constexpr std::chrono::seconds | kDefaultMajorityTimeout {1} |
Default timeout for "majority" write concern. | |
Enumerator | |
---|---|
kMajority | Wait until propagation to a "majority" of RS nodes. |
kUnacknowledged | Do not check for operation errors, do not wait for write, same as |
Definition at line 82 of file options.hpp.
|
staticconstexpr |
Default timeout for "majority" write concern.
Definition at line 90 of file options.hpp.