32class tao_json_serializer;
73 std::vector<entry> entries,
76 , entries_(std::move(entries))
91 template<
typename Document,
93 std::enable_if_t<codec::is_serializer_v<Serializer>,
bool> =
true>
94 [[nodiscard]]
auto content_as(std::size_t index)
const -> Document
96 for (
const entry& e : entries_) {
97 if (e.original_index == index) {
98 return Serializer::template deserialize<Document>(e.value);
102 "invalid index for mutate_in result: " + std::to_string(index));
115 template<
typename Document,
117 std::enable_if_t<codec::is_serializer_v<Serializer>,
bool> =
true>
118 [[nodiscard]]
auto content_as(
const std::string& path)
const -> Document
120 for (
const entry& e : entries_) {
121 if (e.path == path) {
122 return Serializer::template deserialize<Document>(e.value);
126 "invalid path for mutate_in result: " + path);
155 [[nodiscard]]
auto has_value(std::size_t index)
const ->
bool
157 for (
const entry& e : entries_) {
158 if (e.original_index == index) {
159 return !e.value.empty();
163 "invalid index for mutate_in result: " + std::to_string(index));
175 [[nodiscard]]
auto has_value(
const std::string& path)
const ->
bool
177 for (
const entry& e : entries_) {
178 if (e.path == path) {
179 return !e.value.empty();
183 "invalid path for mutate_in result: " + path);
187 std::vector<entry> entries_{};
188 bool is_deleted_{
false };
CAS is a special type that represented in protocol using unsigned 64-bit integer, but only equality c...
Definition cas.hxx:34
Definition tao_json_serializer.hxx:42
Represents result of mutate_in operations.
Definition mutate_in_result.hxx:42
mutate_in_result(couchbase::cas cas, couchbase::mutation_token token, std::vector< entry > entries, bool is_deleted)
Constructs result for mutate_in_result operation.
Definition mutate_in_result.hxx:71
auto content_as(const std::string &path) const -> Document
Decodes field of the document into type.
Definition mutate_in_result.hxx:118
auto has_value(const std::string &path) const -> bool
Returns whether the field has value.
Definition mutate_in_result.hxx:175
auto has_value(std::size_t index) const -> bool
Returns whether the field has value.
Definition mutate_in_result.hxx:155
mutate_in_result()=default
auto is_deleted() const -> bool
Returns whether this document was deleted (a tombstone).
Definition mutate_in_result.hxx:141
auto content_as(std::size_t index) const -> Document
Decodes field of the document into type.
Definition mutate_in_result.hxx:94
Represents result of mutation operations.
Definition mutation_result.hxx:35
Value object to contain partition details and sequence number.
Definition mutation_token.hxx:32
std::vector< std::byte > binary
Definition encoded_value.hxx:25
@ path_invalid
The path provided for a sub-document operation was not syntactically correct.
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
Definition mutate_in_result.hxx:48
std::string path
Definition mutate_in_result.hxx:49
codec::binary value
Definition mutate_in_result.hxx:50
std::size_t original_index
Definition mutate_in_result.hxx:51