22 #include <mongocxx/client-fwd.hpp>
23 #include <mongocxx/collection-fwd.hpp>
24 #include <mongocxx/database-fwd.hpp>
25 #include <mongocxx/events/topology_description-fwd.hpp>
26 #include <mongocxx/options/transaction-fwd.hpp>
27 #include <mongocxx/read_preference-fwd.hpp>
28 #include <mongocxx/search_index_view-fwd.hpp>
29 #include <mongocxx/uri-fwd.hpp>
31 #include <bsoncxx/array/view_or_value.hpp>
32 #include <bsoncxx/document/view_or_value.hpp>
33 #include <bsoncxx/stdx/optional.hpp>
34 #include <mongocxx/options/transaction.hpp>
35 #include <mongocxx/stdx.hpp>
37 #include <mongocxx/config/prelude.hpp>
288 friend ::
mongocxx::v_noabi::events::topology_description;
289 friend ::
mongocxx::v_noabi::options::transaction;
308 class MONGOCXX_PRIVATE impl;
310 MONGOCXX_PRIVATE
read_preference(std::unique_ptr<impl>&& implementation);
312 std::unique_ptr<impl> _impl;
318 #include <mongocxx/config/postlude.hpp>
Class representing a client connection to MongoDB.
Definition: client.hpp:61
Class representing server side document groupings within a MongoDB database.
Definition: collection.hpp:86
Class representing a MongoDB database.
Definition: database.hpp:46
Class representing a preference for how the driver routes read operations to members of a replica set...
Definition: read_preference.hpp:63
read_preference(read_mode mode)
Constructs a new read_preference.
stdx::optional< std::chrono::seconds > max_staleness() const
Returns the current max staleness setting for this read_preference.
read_preference & operator=(const read_preference &)
Copy assigns a read_preference.
read_preference(read_preference &&) noexcept
Move constructs a read_preference.
read_preference(read_mode mode, bsoncxx::v_noabi::document::view_or_value tags)
Constructs a new read_preference with tags.
const stdx::optional< bsoncxx::v_noabi::document::view > hedge() const
Gets the current hedge document to be used for the read preference.
read_mode
Determines which members in a replica set are acceptable to read from.
Definition: read_preference.hpp:76
@ k_nearest
Read from the node with the lowest latency irrespective of state.
@ k_primary
Only read from a primary node.
@ k_secondary_preferred
Prefer to read from secondary nodes.
@ k_secondary
Only read from secondary nodes.
@ k_primary_preferred
Prefer to read from a primary node.
read_preference()
Constructs a new read_preference with read_mode set to k_primary.
read_preference(const read_preference &)
Copy constructs a read_preference.
read_mode mode() const
Returns the current read_mode for this read_preference.
stdx::optional< bsoncxx::v_noabi::document::view > tags() const
Sets or updates the tag set list for this read_preference.
Class representing a MongoDB search index view.
Definition: search_index_view.hpp:23
Class representing a MongoDB connection string URI.
Definition: uri.hpp:47
The top-level namespace for bsoncxx library entities.
Definition: element-fwd.hpp:19
The top-level namespace for mongocxx library entities.
Definition: bulk_write-fwd.hpp:19
Definition: read_preference.hpp:108