50 enum class transaction_state {
52 k_transaction_starting,
53 k_transaction_in_progress,
54 k_transaction_committed,
55 k_transaction_aborted,
205 friend ::mongocxx::v_noabi::bulk_write;
206 friend ::mongocxx::v_noabi::client;
207 friend ::mongocxx::v_noabi::collection;
208 friend ::mongocxx::v_noabi::database;
209 friend ::mongocxx::v_noabi::index_view;
210 friend ::mongocxx::v_noabi::search_index_view;
217 const impl& _get_impl()
const;
219 std::unique_ptr<impl> _impl;
Declares mongocxx::v_noabi::bulk_write.
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition client_session.hpp:48
void advance_operation_time(const bsoncxx::v_noabi::types::b_timestamp &operation_time)
Advance the session's operation time, expressed as a BSON timestamp. Has an effect only if the new op...
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...
transaction_state get_transaction_state() const noexcept
Returns the current transaction state for this session.
void advance_cluster_time(const bsoncxx::v_noabi::document::view &cluster_time)
Advance the cluster time for a session. Has an effect only if the new cluster time is greater than th...
void with_transaction(with_transaction_cb cb, options::transaction opts={})
Helper to run a user-provided callback within a transaction.
const options::client_session & options() const noexcept
Gets the options this session was created with.
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...
std::function< void MONGOCXX_ABI_CDECL(client_session *)> with_transaction_cb
Represents a callback invoked within a transaction.
Definition client_session.hpp:178
bool get_dirty() const noexcept
Returns whether or not this session is dirty.
void start_transaction(const stdx::optional< options::transaction > &transaction_opts={})
Starts a transaction on the current client session.
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 commit_transaction()
Commits a transaction on the current client session.
Class representing a client connection to MongoDB.
Definition client.hpp:62
Class representing the optional arguments to mongocxx::v_noabi::client::start_session.
Definition client_session.hpp:34
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.
#define MONGOCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition fwd.hpp:214
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
Declares mongocxx::v_noabi::index_view.
The mongocxx macro guard postlude header.
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Provides std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::options::client_session.
Declares mongocxx::v_noabi::search_index_view.