93 return std::move(_wc);
204 return _wc.journal().value_or(
false);
231 return static_cast<level>(_wc.acknowledge_level());
241 if (
auto const opt = _wc.tag()) {
262 return _wc.timeout();
271 return _wc.is_acknowledged();
293 return !(lhs == rhs);
305 return {std::move(v)};
A polyfill for std::optional<T>.
Definition optional.hpp:799
A polyfill for std::string_view.
Definition string_view.hpp:412
A read-only BSON document that owns its underlying buffer.
Definition value.hpp:48
Options related to a MongoDB Write Concern.
Definition write_concern.hpp:49
@ k_majority
"w": "majority"
Definition write_concern.hpp:72
The level of acknowledgment requested for write operations to a MongoDB server.
Definition write_concern.hpp:54
level acknowledge_level() const
Gets the current acknowledgment level.
Definition write_concern.hpp:230
bool is_acknowledged() const
Gets whether this write_concern requires an acknowledged write.
Definition write_concern.hpp:270
void majority(std::chrono::milliseconds timeout)
Requires that a majority of the nodes in a replica set acknowledge a write operation before it is con...
Definition write_concern.hpp:168
write_concern()=default
Constructs a new write_concern.
void timeout(std::chrono::milliseconds timeout)
Sets an upper bound on the time a write concern can take to be satisfied. If the write concern cannot...
friend bool operator!=(write_concern const &lhs, write_concern const &rhs)
Compares two write_concern objects for (in)-equality.
Definition write_concern.hpp:292
std::chrono::milliseconds timeout() const
Gets the current timeout for this write_concern.
Definition write_concern.hpp:261
bool journal() const
Gets the current status of the journal parameter.
Definition write_concern.hpp:203
level
A class to represent the write concern level for write operations.
Definition write_concern.hpp:66
@ k_unacknowledged
Represent write concern with w: 0.
Definition write_concern.hpp:70
@ k_tag
Represent write concern with w: <custom write concern name>.
Definition write_concern.hpp:69
@ k_acknowledged
Represent write concern with w: 1.
Definition write_concern.hpp:71
@ k_majority
Represent write concern with w: "majority".
Definition write_concern.hpp:68
@ k_default
Represent the implicit default write concern.
Definition write_concern.hpp:67
void journal(bool journal)
Sets the journal parameter for this write concern.
Definition write_concern.hpp:111
void acknowledge_level(level confirm_level)
Sets the acknowledge level.
void nodes(std::int32_t confirm_from)
Sets the number of nodes that are required to acknowledge the write before the operation is considere...
bsoncxx::v_noabi::document::value to_document() const
Gets the document form of this write_concern.
Definition write_concern.hpp:280
bool majority() const
Gets whether the majority of nodes is currently required by this write_concern.
Definition write_concern.hpp:252
friend bool operator==(write_concern const &lhs, write_concern const &rhs)
Compares two write_concern objects for (in)-equality.
write_concern(v1::write_concern rc)
Construct with the mongocxx::v1 equivalent.
Definition write_concern.hpp:82
void tag(bsoncxx::v_noabi::stdx::string_view tag)
Sets the name representing the server-side getLastErrorMode entry containing the list of nodes that m...
Definition write_concern.hpp:182
bsoncxx::v_noabi::stdx::optional< std::string > tag() const
Gets the current getLastErrorMode that is required by this write_concern.
Definition write_concern.hpp:239
bsoncxx::v_noabi::stdx::optional< std::int32_t > nodes() const
Gets the current number of nodes that this write_concern requires operations to reach....
Definition write_concern.hpp:218
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
v_noabi::array::value from_v1(v1::array::value const &v)
Convert from the bsoncxx::v1 equivalent of v.
Definition value.hpp:267
Declares entities whose ABI stability is NOT guaranteed.
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v_noabi::options::transaction.
Provides mongocxx::v_noabi::options::transaction.
Provides mongocxx::v1::write_concern.
Provides bsoncxx::v_noabi::document::value.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.
Declares mongocxx::v_noabi::bulk_write.
Declares mongocxx::v_noabi::client.
Declares mongocxx::v_noabi::collection.
Declares mongocxx::v_noabi::database.
Declares mongocxx::v_noabi::uri.
Declares mongocxx::v_noabi::write_concern.