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
44 explicit ReadPreference(
Mode mode);
45 ReadPreference(
Mode mode, std::vector<formats::bson::Document> tags);
48 std::optional<std::chrono::seconds> GetMaxStaleness()
const;
49 const std::vector<formats::bson::Document>& GetTags()
const;
61 std::optional<std::chrono::seconds> max_staleness_;
62 std::vector<formats::bson::Document> tags_;
101 bool IsMajority()
const;
102 size_t NodesCount()
const;
103 const std::string& Tag()
const;
104 std::optional<
bool> Journal()
const;
105 const std::chrono::milliseconds& Timeout()
const;
116 std::optional<
bool> journal_;
118 std::chrono::milliseconds timeout_;
136 explicit Skip(size_t value) : value_(value) {}
138 size_t Value()
const {
return value_; }
147 explicit Limit(size_t value) : value_(value) {}
149 size_t Value()
const {
return value_; }
165 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;
233 explicit Hint(std::string index_name);
282 explicit Comment(std::string);
284 const std::string& Value()
const;
294 explicit MaxServerTime(
const std::chrono::milliseconds& value) : value_(value) {}
296 const std::chrono::milliseconds& Value()
const {
return value_; }
299 std::chrono::milliseconds value_;