56 _snapshot_time = bsoncxx::v_noabi::from_v1(*st);
68 if (_causal_consistency) {
80 if (_default_transaction_opts) {
115 return _causal_consistency.value_or(
true);
133 _snapshot = enable_snapshot_reads;
141 return _snapshot.value_or(
false);
167 return _snapshot_time;
191 return _default_transaction_opts;
A polyfill for std::optional<T>.
Definition optional.hpp:799
client_session()=default
Default initialization.
Options for mongocxx::v1::client_session.
Definition client_session.hpp:292
options & default_transaction_opts(v1::transaction_options const &v)
Set the "defaultTransactionOptions" field.
options & snapshot_time(bsoncxx::v1::types::b_timestamp v)
Set the "snapshotTime" ("atClusterTime") field.
options & snapshot(bool v)
Set the "snapshot" field.
options & causal_consistency(bool v)
Set the "causalConsistency" field.
Used by client sessions.
Definition client_session.hpp:41
client_session & snapshot(bool enable_snapshot_reads) noexcept
Sets the read concern "snapshot" (not enabled by default).
Definition client_session.hpp:132
client_session(v1::client_session::options const &opts)
Construct with the mongocxx::v1 equivalent.
Definition client_session.hpp:51
client_session & default_transaction_opts(transaction default_transaction_opts)
Sets the default transaction options.
Definition client_session.hpp:180
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::b_timestamp > const & snapshot_time() const
Gets the value of the snapshot_time option.
Definition client_session.hpp:166
client_session & causal_consistency(bool causal_consistency) noexcept
Sets the causal_consistency option.
Definition client_session.hpp:105
client_session()=default
Default initialization.
bool causal_consistency() const noexcept
Gets the value of the causal_consistency option.
Definition client_session.hpp:114
bool snapshot() const noexcept
Gets the value of the snapshot_reads option.
Definition client_session.hpp:140
bsoncxx::v_noabi::stdx::optional< transaction > const & default_transaction_opts() const
Gets the current default transaction options.
Definition client_session.hpp:190
client_session & snapshot_time(bsoncxx::v_noabi::types::b_timestamp snapshot_time)
Sets the snapshot time ("atClusterTime") to use for a snapshot session.
Definition client_session.hpp:158
Used by MongoDB transaction operations.
Definition transaction.hpp:43
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
v1::element::view to_v1(v_noabi::array::element const &v)
Convert to the bsoncxx::v1 equivalent of v.
Definition element.hpp:132
Declares entities representing options to use with various commands.
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.
A BSON replication timestamp value.
Definition types.hpp:601
Provides mongocxx::v_noabi::options::transaction.
Provides entities used to represent BSON types.
Provides mongocxx::v1::client_session.
Provides std::optional-related polyfills for library API usage.
Declares mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::options::client.