96 return _session.cluster_time();
113 return _session.server_id();
120 return _session.get_transaction_state();
127 return _session.get_dirty();
A polyfill for std::optional<T>.
Definition optional.hpp:799
A read-only, non-owning view of a BSON document.
Definition view.hpp:40
A MongoDB client session.
Definition client_session.hpp:48
transaction_state
The state of an associated transaction.
Definition client_session.hpp:61
Supports MongoDB client session operations.
Definition client_session.hpp:58
std::function< void(client_session *)> with_transaction_cb
Represents a callback invoked within a transaction.
Definition client_session.hpp:187
bsoncxx::v_noabi::document::view cluster_time() const noexcept
Get the session's clusterTime, as a BSON document. This is an opaque value suitable for passing to ad...
Definition client_session.hpp:95
transaction_state get_transaction_state() const noexcept
Returns the current transaction state for this session.
Definition client_session.hpp:119
bsoncxx::v_noabi::document::view id() const noexcept
Get the server-side "logical session ID" associated with this session, as a BSON document....
Definition client_session.hpp:85
bsoncxx::v_noabi::types::b_timestamp operation_time() const noexcept
Get the session's operationTime, as a BSON timestamp. This is an opaque value suitable for passing to...
Definition client_session.hpp:104
bool get_dirty() const noexcept
Returns whether or not this session is dirty.
Definition client_session.hpp:126
void with_transaction(with_transaction_cb cb, v_noabi::options::transaction opts={})
Helper to run a user-provided callback within a transaction.
void abort_transaction()
Aborts a transaction on the current client session.
std::uint32_t server_id() const noexcept
Get the server_id the session is pinned to. The server_id is zero if the session is not pinned to a s...
Definition client_session.hpp:112
void advance_cluster_time(bsoncxx::v_noabi::document::view const &cluster_time)
Advance the cluster time for a session. Has an effect only if the new cluster time is greater than th...
Definition client_session.hpp:138
options::client_session const & options() const noexcept
Gets the options this session was created with.
Definition client_session.hpp:77
void advance_operation_time(bsoncxx::v_noabi::types::b_timestamp const &operation_time)
Advance the session's operation time, expressed as a BSON timestamp. Has an effect only if the new op...
Definition client_session.hpp:150
void commit_transaction()
Commits a transaction on the current client session.
void start_transaction(bsoncxx::v_noabi::stdx::optional< v_noabi::options::transaction > const &transaction_opts={})
Starts a transaction on the current client session.
v_noabi::client const & client() const noexcept
Gets the client that started this session.
Definition client_session.hpp:70
A client connection to a MongoDB server.
Definition client.hpp:76
Used by client sessions.
Definition client_session.hpp:40
Used by MongoDB transaction operations.
Definition transaction.hpp:43
Declares mongocxx::v_noabi::index_view.
#define MONGOCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition export.hpp:49
#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.
v1::element::view to_v1(v_noabi::array::element const &v)
Convert to the bsoncxx::v1 equivalent of v.
Definition element.hpp:132
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 representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v_noabi::search_index_view.
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 bsoncxx::v_noabi::document::view.
Provides std::optional-related polyfills for library API usage.
Declares mongocxx::v_noabi::bulk_write.
Declares mongocxx::v_noabi::client.
Declares mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::collection.
Declares mongocxx::v_noabi::database.
Provides mongocxx::v_noabi::options::client_session.