Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
|
#include <couchbase/mutate_in_specs.hxx>
Public Member Functions | |
mutate_in_specs ()=default | |
template<typename... Operation> | |
mutate_in_specs (Operation... args) | |
template<typename Operation > | |
void | push_back (const Operation &operation) |
Add subdocument operation to list of specs. | |
template<typename Operation , typename... Rest> | |
void | push_back (const Operation &operation, Rest... args) |
Add subdocument operations to list of specs. | |
auto | specs () const -> const std::vector< core::impl::subdoc::command > & |
Returns internal representation of the specs. | |
Static Public Member Functions | |
template<typename Value > | |
static auto | replace (std::string path, const Value &value) -> subdoc::replace |
Creates a spec with the intention of replacing an existing value in a JSON document. | |
static auto | replace (std::string path, subdoc::mutate_in_macro value) -> subdoc::replace |
Creates a spec with the intention of replacing an existing value in a JSON document. | |
static auto | replace_raw (std::string path, std::vector< std::byte > value, bool expand_macro=false) -> subdoc::replace |
Creates a spec with the intention of replacing an existing value in a JSON document. | |
template<typename Value > | |
static auto | insert (std::string path, const Value &value) -> subdoc::insert |
Creates a command with the intention of inserting a new value in a JSON object. | |
static auto | insert (std::string path, subdoc::mutate_in_macro value) -> subdoc::insert |
Creates a command with the intention of inserting a new value in a JSON object. | |
static auto | insert_raw (std::string path, std::vector< std::byte > value, bool expand_macro=false) -> subdoc::insert |
Creates a command with the intention of inserting a new value in a JSON object. | |
static auto | remove (std::string path) -> subdoc::remove |
Creates a command with the intention of removing an existing value in a JSON object. | |
template<typename Value , typename Transcoder = codec::default_json_transcoder> | |
static auto | upsert (std::string path, const Value &value) -> subdoc::upsert |
Creates a command with the intention of upserting a value in a JSON object. | |
static auto | upsert (std::string path, subdoc::mutate_in_macro value) -> subdoc::upsert |
Creates a command with the intention of upserting a value in a JSON object. | |
static auto | upsert_raw (std::string path, std::vector< std::byte > value, bool expand_macro=false) -> subdoc::upsert |
Creates a command with the intention of upserting a value in a JSON object. | |
static auto | increment (std::string path, std::int64_t delta) -> subdoc::counter |
Creates a command with the intent of incrementing a numerical field in a JSON object. | |
static auto | decrement (std::string path, std::int64_t delta) -> subdoc::counter |
Creates a command with the intent of decrementing a numerical field in a JSON object. | |
template<typename... Values> | |
static auto | array_append (std::string path, Values... values) -> subdoc::array_append |
Creates a command with the intention of appending a value to an existing JSON array. | |
static auto | array_append_raw (std::string path, std::vector< std::byte > values) -> subdoc::array_append |
Creates a command with the intention of appending a value to an existing JSON array. | |
template<typename... Values> | |
static auto | array_prepend (std::string path, Values... values) -> subdoc::array_prepend |
Creates a command with the intention of prepending a value to an existing JSON array. | |
static auto | array_prepend_raw (std::string path, std::vector< std::byte > values) -> subdoc::array_prepend |
Creates a command with the intention of prepending a value to an existing JSON array. | |
template<typename... Values> | |
static auto | array_insert (std::string path, Values... values) -> subdoc::array_insert |
Creates a command with the intention of inserting a value into an existing JSON array. | |
static auto | array_insert_raw (std::string path, std::vector< std::byte > values) -> subdoc::array_insert |
Creates a command with the intention of inserting a value into an existing JSON array. | |
template<typename Value , typename Transcoder = codec::default_json_transcoder> | |
static auto | array_add_unique (std::string path, const Value &value) -> subdoc::array_add_unique |
Creates a command with the intent of inserting a value into an existing JSON array, but only if the value is not already contained in the array (by way of string comparison). | |
static auto | array_add_unique (std::string path, subdoc::mutate_in_macro value) -> subdoc::array_add_unique |
Creates a command with the intent of inserting a value into an existing JSON array, but only if the value is not already contained in the array (by way of string comparison). | |
static auto | array_add_unique_raw (std::string path, std::vector< std::byte > value, bool expand_macro=false) -> subdoc::array_add_unique |
Creates a command with the intent of inserting a value into an existing JSON array, but only if the value is not already contained in the array (by way of string comparison). | |
|
default |
|
inlineexplicit |
|
inlinestatic |
Creates a command with the intent of inserting a value into an existing JSON array, but only if the value is not already contained in the array (by way of string comparison).
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value, and an index. E.g. "foo.bar[3]" |
value | the value to insert. |
|
inlinestatic |
Creates a command with the intent of inserting a value into an existing JSON array, but only if the value is not already contained in the array (by way of string comparison).
Will error if the last element of the path does not exist or is not an array. The macro will be expanded on the server side.
path | the path identifying an array to which to append the value, and an index. E.g. "foo.bar[3]" |
value | the macro value to insert. |
|
inlinestatic |
Creates a command with the intent of inserting a value into an existing JSON array, but only if the value is not already contained in the array (by way of string comparison).
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value, and an index. E.g. "foo.bar[3]" |
value | the value to insert. |
expand_macro | true if the value encodes macro |
|
inlinestatic |
Creates a command with the intention of appending a value to an existing JSON array.
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value. |
values | the value(s) to append. |
|
inlinestatic |
Creates a command with the intention of appending a value to an existing JSON array.
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value. |
values | the value(s) to append. |
|
inlinestatic |
Creates a command with the intention of inserting a value into an existing JSON array.
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value, and an index. E.g. "foo.bar[3]" |
values | the value(s) to insert. |
|
inlinestatic |
Creates a command with the intention of inserting a value into an existing JSON array.
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value, and an index. E.g. "foo.bar[3]" |
values | the value(s) to insert. |
|
inlinestatic |
Creates a command with the intention of prepending a value to an existing JSON array.
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value. |
values | the value(s) to prepend. |
|
inlinestatic |
Creates a command with the intention of prepending a value to an existing JSON array.
Will error if the last element of the path does not exist or is not an array.
path | the path identifying an array to which to append the value. |
values | the value(s) to prepend. |
|
inlinestatic |
Creates a command with the intent of decrementing a numerical field in a JSON object.
path | the path identifying a numerical field to adjust or create. |
delta | the positive value to decrement the field by. |
|
inlinestatic |
Creates a command with the intent of incrementing a numerical field in a JSON object.
If the field does not exist then it is created and takes the value of delta
.
path | the path identifying a numerical field to adjust or create. |
delta | the positive value to increment the field by. |
|
inlinestatic |
Creates a command with the intention of inserting a new value in a JSON object.
Will error if the last element of the path already exists.
path | the path identifying where to insert the value. |
value | the value to insert |
|
inlinestatic |
Creates a command with the intention of inserting a new value in a JSON object.
The macro will be expanded on the server side. Will error if the last element of the path already exists.
path | the path identifying where to insert the value. |
value | the value to insert |
|
inlinestatic |
Creates a command with the intention of inserting a new value in a JSON object.
Will error if the last element of the path already exists.
path | the path identifying where to insert the value. |
value | the value to insert |
expand_macro | true if the value encodes macro |
|
inline |
Add subdocument operation to list of specs.
Operation | type of the subdocument operation |
operation | operation to execute |
|
inline |
Add subdocument operations to list of specs.
Operation | type of the subdocument operation |
Rest | types of the rest of the operations |
operation | operation to execute |
args | the rest of the arguments |
|
inlinestatic |
Creates a command with the intention of removing an existing value in a JSON object.
Will error if the path does not exist.
path | the path identifying what to remove. |
|
inlinestatic |
Creates a spec with the intention of replacing an existing value in a JSON document.
If the path is empty (""), then the value will be used for the document's full body. Will error if the last element of the path does not exist.
path | the path identifying where to replace the value. |
value | the value to replace with. |
|
inlinestatic |
Creates a spec with the intention of replacing an existing value in a JSON document.
The macro will be expanded on the server side.
path | the path identifying where to replace the value. |
value | the value to replace with. |
|
inlinestatic |
Creates a spec with the intention of replacing an existing value in a JSON document.
If the path is empty (""), then the value will be used for the document's full body. Will error if the last element of the path does not exist.
path | the path identifying where to insert the value. |
value | the value to insert |
expand_macro | true if the value encodes macro |
|
nodiscard |
|
inlinestatic |
Creates a command with the intention of upserting a value in a JSON object.
That is, the value will be replaced if the path already exists, or inserted if not.
path | the path identifying where to upsert the value. |
value | the value to upsert. |
|
inlinestatic |
Creates a command with the intention of upserting a value in a JSON object.
That is, the value will be replaced if the path already exists, or inserted if not. The macro will be expanded on the server side.
path | the path identifying where to upsert the value. |
value | the macro value to upsert. |
|
inlinestatic |
Creates a command with the intention of upserting a value in a JSON object.
That is, the value will be replaced if the path already exists, or inserted if not.
path | the path identifying where to upsert the value. |
value | the value to upsert. |
expand_macro | true if the value encodes macro |