52 enum class transaction_state {
54 k_transaction_starting,
55 k_transaction_in_progress,
56 k_transaction_committed,
57 k_transaction_aborted,
215 friend ::mongocxx::v_noabi::bulk_write;
216 friend ::mongocxx::v_noabi::client;
217 friend ::mongocxx::v_noabi::collection;
218 friend ::mongocxx::v_noabi::database;
219 friend ::mongocxx::v_noabi::index_view;
220 friend ::mongocxx::v_noabi::search_index_view;
227 impl
const& _get_impl()
const;
229 std::unique_ptr<impl> _impl;
Declares mongocxx::v_noabi::bulk_write.
client_session(client_session &&) noexcept
Move constructs a session.
std::function< void(client_session *)> with_transaction_cb
Represents a callback invoked within a transaction.
Definition client_session.hpp:180
void start_transaction(bsoncxx::v_noabi::stdx::optional< options::transaction > const &transaction_opts={})
Starts a transaction on the current client session.
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...
mongocxx::v_noabi::client const & client() const noexcept
Gets the client that started this session.
transaction_state get_transaction_state() const noexcept
Returns the current transaction state for this session.
void with_transaction(with_transaction_cb cb, options::transaction opts={})
Helper to run a user-provided callback within a transaction.
client_session(client_session &&) noexcept
Move constructs a session.
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...
bool get_dirty() const noexcept
Returns whether or not this session is dirty.
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...
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...
options::client_session const & options() const noexcept
Gets the options this session was created with.
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...
void commit_transaction()
Commits a transaction on the current client session.
A client connection to a MongoDB server.
Definition client.hpp:61
Used by client sessions.
Definition client_session.hpp:33
Declares mongocxx::v_noabi::client.
Declares mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::collection.
Declares mongocxx::v_noabi::database.
Provides bsoncxx::v_noabi::document::view.
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.
The top-level namespace within which all bsoncxx library entities are declared.
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.
Provides mongocxx::v_noabi::options::client_session.
Declares mongocxx::v_noabi::search_index_view.
Provides std::optional-related polyfills for library API usage.