#include <mongocxx/v_noabi/mongocxx/read_concern.hpp>
Controls the consistency and isolation properties of data read from replica sets and sharded clusters.
Read concern can be set at the client, database, or collection level. The read concern can also be provided via connection string, and will be parsed and set on the client constructed for the URI.
Public Types | |
| enum class | level |
| A class to represent the read concern level for read operations. More... | |
Public Member Functions | |
| read_concern ()=default | |
| Constructs a new read_concern with default acknowledge_level of k_server_default. | |
| read_concern (v1::read_concern rc) | |
| Construct with the mongocxx::v1 equivalent. | |
| level | acknowledge_level () const |
| Gets the current read concern level. | |
| void | acknowledge_level (level rc_level) |
| Sets the read concern level. | |
| bsoncxx::v1::stdx::string_view | acknowledge_string () const |
| Gets the current read concern string. | |
| void | acknowledge_string (bsoncxx::v1::stdx::string_view rc_string) |
| Sets the read concern string. Any valid read concern string (e.g. "local", "majority", "linearizable", "") may be passed in. For forward-compatibility with read concern levels introduced in the future, no validation is performed on this string. | |
| operator v1::read_concern () && | |
| Convert to the mongocxx::v1 equivalent. | |
| operator v1::read_concern () const & | |
| Convert to the mongocxx::v1 equivalent. | |
| bsoncxx::v_noabi::document::value | to_document () const |
| Gets the document form of this read_concern. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| bool | operator== (read_concern const &lhs, read_concern const &rhs) |
| Compares two read_concern objects for (in)-equality. | |
| bool | operator!= (read_concern const &lhs, read_concern const &rhs) |
| Compares two read_concern objects for (in)-equality. | |
|
strong |
A class to represent the read concern level for read operations.
|
default |
Constructs a new read_concern with default acknowledge_level of k_server_default.
The k_server_default acknowledge level has an empty acknowledge_string. Queries that run with this read_concern will use the server's default read_concern instead of specifying one.
|
inline |
Construct with the mongocxx::v1 equivalent.
|
inline |
Gets the current read concern level.
If this was set with acknowledge_string to anything other than "local", "majority", "linearizable", or an empty string, this will return k_unknown.
| void mongocxx::v_noabi::read_concern::acknowledge_level | ( | level | rc_level | ) |
Sets the read concern level.
| rc_level | Either k_local, k_majority, k_linearizable, or k_server_default. |
| mongocxx::v_noabi::exception | if rc_level is not k_local, k_majority, k_linearizable, or k_server_default. |
|
inline |
Gets the current read concern string.
If the read concern level was set with acknowledge_level, this will return either "local", "majority", "linearizable", or an empty string for k_server_default.
|
inline |
Sets the read concern string. Any valid read concern string (e.g. "local", "majority", "linearizable", "") may be passed in. For forward-compatibility with read concern levels introduced in the future, no validation is performed on this string.
| rc_string | The read concern string. |
|
inlineexplicit |
Convert to the mongocxx::v1 equivalent.
|
inlineexplicit |
Convert to the mongocxx::v1 equivalent.
|
inline |
Gets the document form of this read_concern.
|
friend |
Compares two read_concern objects for (in)-equality.
|
friend |
Compares two read_concern objects for (in)-equality.