MongoDB C++ Driver  mongocxx-3.4.0
Public Member Functions | List of all members
mongocxx::options::client_session Class Reference

Class representing the optional arguments to mongocxx::client::start_session. More...

#include <client_session.hpp>

Public Member Functions

client_sessioncausal_consistency (bool causal_consistency) noexcept
 Sets the causal_consistency option. More...
 
bool causal_consistency () const noexcept
 Gets the current value of the causal_consistency option.
 
client_sessiondefault_transaction_opts (transaction default_transaction_opts)
 Sets the default transaction options. More...
 
const stdx::optional< transaction > & default_transaction_opts () const
 Gets the current default transaction options. More...
 

Detailed Description

Class representing the optional arguments to mongocxx::client::start_session.

Member Function Documentation

◆ causal_consistency()

client_session& mongocxx::options::client_session::causal_consistency ( bool  causal_consistency)
noexcept

Sets the causal_consistency option.

If true (the default), each operation in the session will be causally ordered after the previous read or write operation. Set to false to disable causal consistency.

Unacknowledged writes are not causally consistent. If you execute a write operation with an unacknowledged write concern (a mongocxx::write_concern with mongocxx::write_concern::acknowledge_level of k_unacknowledged), the write does not participate in causal consistency.

Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/core/read-isolation-consistency-recency/#causal-consistency

◆ default_transaction_opts() [1/2]

client_session& mongocxx::options::client_session::default_transaction_opts ( transaction  default_transaction_opts)

Sets the default transaction options.

Parameters
default_transaction_optsThe default transaction options.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ default_transaction_opts() [2/2]

const stdx::optional<transaction>& mongocxx::options::client_session::default_transaction_opts ( ) const

Gets the current default transaction options.

Returns
The default transaction options.

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