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.
transaction & | max_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.
transaction & | operator= (transaction &&other) noexcept=default
| Move assigns transaction options.
transaction & | operator= (transaction const &other)
| Copy assigns transaction options.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > | read_concern () const
| Gets the current transaction read concern.
transaction & | read_concern (v_noabi::read_concern const &rc)
| Sets the transaction read concern.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_preference > | read_preference () const
| Gets the current transaction read preference.
transaction & | read_preference (v_noabi::read_preference const &rp)
| Sets the transaction read preference.
bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > | write_concern () const
| Gets the current transaction write concern.
transaction & | write_concern (v_noabi::write_concern const &wc)
| Sets the transaction write concern.

## Constructor & Destructor Documentation

## transaction() [1/4]

mongocxx::v_noabi::options::transaction::transaction | ( |  | ) |

default

Default initialization.

## transaction() [2/4]

mongocxx::v_noabi::options::transaction::transaction | ( | transaction const & | other | ) |

Copy constructs transaction options.

## transaction() [3/4]

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

default noexcept

Move constructs transaction options.

## transaction() [4/4]

mongocxx::v_noabi::options::transaction::transaction | ( | v1::transaction_options | txn | ) |

inline

Construct with the mongocxx::v1 equivalent.

## ~transaction()

mongocxx::v_noabi::options::transaction::~transaction | ( |  | ) |

default noexcept

Destroys the transaction options.

## Member Function Documentation

## max_commit_time_ms() [1/2]

bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > mongocxx::v_noabi::options::transaction::max_commit_time_ms | ( |  | ) | const

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]

transaction & mongocxx::v_noabi::options::transaction::max_commit_time_ms | ( | std::chrono::milliseconds | ms | ) |

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

Parameters

  ms | The 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 | ( |  | ) | &&

inline explicit

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 &

inline explicit

Convert to the mongocxx::v1 equivalent.

## operator=() [1/2]

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

default noexcept

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]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > mongocxx::v_noabi::options::transaction::read_concern | ( |  | ) | const

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]

transaction & mongocxx::v_noabi::options::transaction::read_concern | ( | v_noabi::read_concern const & | rc | ) |

Sets the transaction read concern.

Parameters

  rc | The read concern.

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

## read_preference() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_preference > mongocxx::v_noabi::options::transaction::read_preference | ( |  | ) | const

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]

transaction & mongocxx::v_noabi::options::transaction::read_preference | ( | v_noabi::read_preference const & | rp | ) |

Sets the transaction read preference.

Parameters

  rp | The read preference.

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

## write_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > mongocxx::v_noabi::options::transaction::write_concern | ( |  | ) | const

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]

transaction & mongocxx::v_noabi::options::transaction::write_concern | ( | v_noabi::write_concern const & | wc | ) |

Sets the transaction write concern.

Parameters

  wc | The 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:

- mongocxx/v_noabi/mongocxx/options/transaction.hpp