9#include <initializer_list>
16#include <userver/formats/bson/bson_builder.hpp>
17#include <userver/formats/bson/document.hpp>
18#include <userver/formats/bson/value.hpp>
20USERVER_NAMESPACE_BEGIN
42 explicit ReadPreference(
Mode mode);
43 ReadPreference(
Mode mode, std::vector<formats::bson::Document> tags);
46 std::optional<std::chrono::seconds> GetMaxStaleness()
const;
47 const std::vector<formats::bson::Document>& GetTags()
const;
52 std::optional<std::chrono::seconds> max_staleness);
60 std::optional<std::chrono::seconds> max_staleness_;
61 std::vector<formats::bson::Document> tags_;
100 bool IsMajority()
const;
101 size_t NodesCount()
const;
102 const std::string& Tag()
const;
103 std::optional<
bool> Journal()
const;
104 const std::chrono::milliseconds& Timeout()
const;
115 std::optional<
bool> journal_;
117 std::chrono::milliseconds timeout_;
135 explicit Skip(size_t value) : value_(value) {}
137 size_t Value()
const {
return value_; }
146 explicit Limit(size_t value) : value_(value) {}
148 size_t Value()
const {
return value_; }
164 Projection(std::initializer_list<std::string_view> fields_to_include);
195 const bson_t* GetProjectionBson()
const;
199 formats::
bson::impl::BsonBuilder projection_builder_;
217 Sort&
By(std::string_view field, Direction direction);
221 const bson_t* GetSortBson()
const;
225 formats::
bson::impl::BsonBuilder sort_builder_;
233 explicit Hint(std::string index_name);
240 const formats::
bson::
Value& Value()
const;
257 const formats::
bson::
Value& Value()
const;
282 explicit Comment(std::string);
284 const std::string& Value()
const;
294 explicit MaxServerTime(
const std::chrono::milliseconds& value)
297 const std::chrono::milliseconds& Value()
const {
return value_; }
300 std::chrono::milliseconds value_;