MongoDB C++ Driver  mongocxx-3.3.0
All Classes Namespaces Functions Enumerations Enumerator Friends Pages
Public Member Functions | Related 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.
 

Related Functions

(Note that these are not member functions.)

bool operator== (const client_session &, const client_session &)
 Compare session options for equality.
 
bool operator!= (const client_session &, const client_session &)
 Compare session options for inequality.
 
bool operator== (const client_session &, const client_session &)
 Compare session options for equality.
 
bool operator!= (const client_session &, const client_session &)
 Compare session options for inequality.
 

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

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