MongoDB C++ Driver
mongocxx-3.7.0
|
Class representing the optional arguments to mongocxx::client::start_session. More...
#include <client_session.hpp>
Public Member Functions | |
client_session & | causal_consistency (bool causal_consistency) noexcept |
Sets the causal_consistency option. More... | |
bool | causal_consistency () const noexcept |
Gets the value of the causal_consistency option. | |
client_session & | snapshot (bool enable_snapshot_reads) noexcept |
Sets the read concern "snapshot" (not enabled by default). More... | |
bool | snapshot () const noexcept |
Gets the value of the snapshot_reads option. | |
client_session & | default_transaction_opts (transaction default_transaction_opts) |
Sets the default transaction options. More... | |
const stdx::optional< transaction > & | default_transaction_opts () const |
Gets the current default transaction options. More... | |
Class representing the optional arguments to mongocxx::client::start_session.
|
noexcept |
Sets the causal_consistency option.
If true (the default), each operation in the session will be causally ordered after the previous read or write operation. Set to false to disable causal consistency.
Unacknowledged writes are not causally consistent. If you execute a write operation with an unacknowledged write concern (a mongocxx::write_concern with mongocxx::write_concern::acknowledge_level of k_unacknowledged
), the write does not participate in causal consistency.
const stdx::optional<transaction>& mongocxx::options::client_session::default_transaction_opts | ( | ) | const |
Gets the current default transaction options.
client_session& mongocxx::options::client_session::default_transaction_opts | ( | transaction | default_transaction_opts | ) |
Sets the default transaction options.
default_transaction_opts | The default transaction options. |
|
noexcept |
Sets the read concern "snapshot" (not enabled by default).