61 std::map<std::string, codec::binary, std::less<>>
raw;
85 positional_parameters_,
103 priority_ = prioritized;
167 client_context_id_.reset();
199 mutation_state_.clear();
225 mutation_state_ = state.tokens();
226 scan_consistency_.reset();
241 std::enable_if_t<codec::is_serializer_v<Serializer>,
bool> =
true>
244 raw_[std::move(name)] = std::move(Serializer::template serialize<const Value&>(value));
259 typename... Parameters,
260 std::enable_if_t<codec::is_serializer_v<Serializer>,
bool> =
true>
263 named_parameters_.clear();
264 positional_parameters_.clear();
265 encode_positional_parameters<Serializer>(parameters...);
280 typename... Parameters,
281 std::enable_if_t<codec::is_serializer_v<Serializer>,
bool> =
true>
284 named_parameters_.clear();
285 positional_parameters_.clear();
286 encode_named_parameters<Serializer>(parameters...);
307 raw_ = std::move(options);
328 named_parameters_.clear();
329 positional_parameters_ = std::move(parameters);
350 named_parameters_ = std::move(parameters);
351 positional_parameters_.clear();
359 std::enable_if_t<codec::is_serializer_v<Serializer>,
bool> =
true>
360 void encode_positional_parameters(
const Parameter& parameter, Rest... args)
362 positional_parameters_.emplace_back(
363 std::move(Serializer::template serialize<Parameter>(parameter)));
364 if constexpr (
sizeof...(args) > 0) {
365 encode_positional_parameters<Serializer>(args...);
369 template<
typename Serializer = codec::tao_json_serializer,
373 std::enable_if_t<codec::is_serializer_v<Serializer>,
bool> =
true>
374 void encode_named_parameters(
const std::pair<Name, Parameter>& parameter, Rest... args)
376 named_parameters_[parameter.first] =
377 std::move(Serializer::template serialize<Parameter>(parameter.second));
378 if constexpr (
sizeof...(args) > 0) {
379 encode_named_parameters<Serializer>(args...);
383 bool priority_{
true };
384 bool readonly_{
false };
385 std::optional<std::string> client_context_id_{};
386 std::optional<std::chrono::milliseconds> scan_wait_{};
387 std::optional<analytics_scan_consistency> scan_consistency_{};
388 std::vector<mutation_token> mutation_state_{};
389 std::vector<codec::binary> positional_parameters_{};
390 std::map<std::string, codec::binary, std::less<>> raw_{};
391 std::map<std::string, codec::binary, std::less<>> named_parameters_{};
Represents result of cluster::analytics_query() and scope::analytics_query() calls.
Definition analytics_result.hxx:41
Definition tao_json_serializer.hxx:42
Common options that used by most operations.
Definition common_options.hxx:38
auto self() -> analytics_options &
Definition common_options.hxx:116
auto build_common_options() const -> built
Definition common_options.hxx:103
Aggregation of one or more mutation_tokens for specifying consistency requirements of N1QL or FTS que...
Definition mutation_state.hxx:35
std::vector< std::byte > binary
Definition encoded_value.hxx:25
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
analytics_scan_consistency
Definition analytics_scan_consistency.hxx:22
@ not_bounded
The indexer will return whatever state it has to the query engine at the time of query.
std::function< void(error, analytics_result)> analytics_handler
The signature for the handler of the cluster::analytics_query() and scope::analytics_query() operatio...
Definition analytics_options.hxx:401
Immutable value object representing consistent options.
Definition analytics_options.hxx:52
std::vector< mutation_token > mutation_state
Definition analytics_options.hxx:58
std::map< std::string, codec::binary, std::less<> > named_parameters
Definition analytics_options.hxx:60
const bool priority
Definition analytics_options.hxx:54
const bool readonly
Definition analytics_options.hxx:55
std::optional< std::chrono::milliseconds > scan_wait
Definition analytics_options.hxx:57
std::map< std::string, codec::binary, std::less<> > raw
Definition analytics_options.hxx:61
std::optional< std::string > client_context_id
Definition analytics_options.hxx:53
std::optional< analytics_scan_consistency > scan_consistency
Definition analytics_options.hxx:56
std::vector< codec::binary > positional_parameters
Definition analytics_options.hxx:59
Options for cluster::analytics_query() and scope::analytics_query().
Definition analytics_options.hxx:45
auto raw(std::string name, const Value &value) -> analytics_options &
Definition analytics_options.hxx:242
auto client_context_id(std::string client_context_id) -> analytics_options &
Supports providing a custom client context ID for this query.
Definition analytics_options.hxx:164
auto positional_parameters(const Parameters &... parameters) -> analytics_options &
Set list of positional parameters for a query.
Definition analytics_options.hxx:261
auto scan_consistency(analytics_scan_consistency scan_consistency) -> analytics_options &
Customizes the consistency guarantees for this query.
Definition analytics_options.hxx:196
auto encoded_raw_options(std::map< std::string, codec::binary, std::less<> > options) -> analytics_options &
Set map of raw options for a query.
Definition analytics_options.hxx:304
auto encoded_positional_parameters(std::vector< codec::binary > parameters) -> analytics_options &
Set list of positional parameters for a query.
Definition analytics_options.hxx:326
auto readonly(bool readonly) -> analytics_options &
Allows explicitly marking a query as being readonly and not mutating and documents on the server side...
Definition analytics_options.hxx:123
auto scan_wait(std::chrono::milliseconds wait) -> analytics_options &
Allows customizing how long the query engine is willing to wait until the index catches up to whateve...
Definition analytics_options.hxx:142
auto priority(bool prioritized) -> analytics_options &
Allows to give certain requests higher priority than others.
Definition analytics_options.hxx:101
auto build() const -> built
Validates options and returns them as an immutable value.
Definition analytics_options.hxx:75
auto consistent_with(const mutation_state &state) -> analytics_options &
Sets the mutation_tokens this query should be consistent with.
Definition analytics_options.hxx:223
auto encoded_named_parameters(std::map< std::string, codec::binary, std::less<> > parameters) -> analytics_options &
Set map of named parameters for a query.
Definition analytics_options.hxx:347
auto named_parameters(const Parameters &... parameters) -> analytics_options &
Set list of named parameters for a query.
Definition analytics_options.hxx:282