MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
mongocxx::options::transaction Class Reference

#include <mongocxx/v_noabi/mongocxx/options/transaction.hpp>

Description

Used by MongoDB transaction operations.

Public Member Functions

 transaction ()=default
 Default initialization.
 transaction (transaction &&other) noexcept=default
 Move constructs transaction options.
 transaction (transaction const &other)
 Copy constructs transaction options.
 transaction (v1::transaction_options txn)
 Construct with the mongocxx::v1 equivalent.
 ~transaction () noexcept=default
 Destroys the transaction options.
bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > max_commit_time_ms () const
 Gets the current transaction commit time, in milliseconds.
transactionmax_commit_time_ms (std::chrono::milliseconds ms)
 Sets the transaction's max commit time, in milliseconds.
 operator v1::transaction_options () &&
 Convert to the mongocxx::v1 equivalent.
 operator v1::transaction_options () const &
 Convert to the mongocxx::v1 equivalent.
transactionoperator= (transaction &&other) noexcept=default
 Move assigns transaction options.
transactionoperator= (transaction const &other)
 Copy assigns transaction options.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_concernread_concern () const
 Gets the current transaction read concern.
transactionread_concern (v_noabi::read_concern const &rc)
 Sets the transaction read concern.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_preferenceread_preference () const
 Gets the current transaction read preference.
transactionread_preference (v_noabi::read_preference const &rp)
 Sets the transaction read preference.
bsoncxx::v_noabi::stdx::optional< v_noabi::write_concernwrite_concern () const
 Gets the current transaction write concern.
transactionwrite_concern (v_noabi::write_concern const &wc)
 Sets the transaction write concern.

Constructor & Destructor Documentation

◆ transaction() [1/4]

Default initialization.

◆ transaction() [2/4]

Copy constructs transaction options.

◆ transaction() [3/4]

mongocxx::v_noabi::options::transaction::transaction ( transaction && other)
defaultnoexcept

Move constructs transaction options.

◆ transaction() [4/4]

◆ ~transaction()

Destroys the transaction options.

Member Function Documentation

◆ max_commit_time_ms() [1/2]

Gets the current transaction commit time, in milliseconds.

Returns
An optional containing the timeout. If the max commit time has not been set, a disengaged optional is returned.

◆ max_commit_time_ms() [2/2]

Sets the transaction's max commit time, in milliseconds.

Parameters
msThe max commit time in milliseconds.
Returns
A reference to the object on which this function is being called.

◆ operator v1::transaction_options() [1/2]

mongocxx::v_noabi::options::transaction::operator v1::transaction_options ( ) &&
inlineexplicit

Convert to the mongocxx::v1 equivalent.

Postconditions:
  • *this is in an assign-or-destroy-only state.

◆ operator v1::transaction_options() [2/2]

mongocxx::v_noabi::options::transaction::operator v1::transaction_options ( ) const &
inlineexplicit

Convert to the mongocxx::v1 equivalent.

◆ operator=() [1/2]

transaction & mongocxx::v_noabi::options::transaction::operator= ( transaction && other)
defaultnoexcept

Move assigns transaction options.

◆ operator=() [2/2]

transaction & mongocxx::v_noabi::options::transaction::operator= ( transaction const & other)

Copy assigns transaction options.

◆ read_concern() [1/2]

Gets the current transaction read concern.

Returns
An optional containing the read concern. If the read concern has not been set, a disengaged optional is returned.

◆ read_concern() [2/2]

Sets the transaction read concern.

Parameters
rcThe read concern.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ read_preference() [1/2]

Gets the current transaction read preference.

Returns
An optional containing the read preference. If the read preference has not been set, a disengaged optional is returned.

◆ read_preference() [2/2]

Sets the transaction read preference.

Parameters
rpThe read preference.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ write_concern() [1/2]

Gets the current transaction write concern.

Returns
The write concern.
An optional containing the write concern. If the write concern has not been set, a disengaged optional is returned.

◆ write_concern() [2/2]

Sets the transaction write concern.

Parameters
wcThe write concern.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

The documentation for this class was generated from the following file: