1#ifndef _DITTO_MUTABLE_DOCUMENT_PATH_
2#define _DITTO_MUTABLE_DOCUMENT_PATH_
4#include "AttachmentToken.hpp"
5#include "UpdateResult.hpp"
9typedef struct CDocument CDocument_t;
25 CDocument_t
const *document;
27 std::vector<std::unique_ptr<UpdateResult>> &results;
48 std::string initial_path,
49 std::vector<std::unique_ptr<UpdateResult>> &results);
65 std::string component);
This is used as part of update operations for documents.
Definition: MutableDocument.hpp:29
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition: MutableDocumentPath.hpp:21
bool get_bool_value() const
Returns the value at the previously specified key in the document as a bool. If the key was invalid a...
Definition: MutableDocumentPath.cpp:81
nlohmann::json pop() const
Pop a value off the end of an array at the document's key defined by the preceding subscripting....
Definition: MutableDocumentPath.cpp:165
nlohmann::json get_json() const
Returns the value at the previously specified key in the document as a nlohmann::json object....
Definition: MutableDocumentPath.cpp:89
std::string get_string_value() const
Returns the value at the previously specified key in the document as a std::string....
Definition: MutableDocumentPath.cpp:49
int get_int_value() const
Returns the value at the previously specified key in the document as an int. If the key was invalid a...
Definition: MutableDocumentPath.cpp:57
void push(nlohmann::json value) const
Push a value on to the end of an array at the document's key defined by the preceding subscripting....
Definition: MutableDocumentPath.cpp:156
void set(nlohmann::json value, bool is_default=false) const
Set a value at the document's key defined by the preceding subscripting.
Definition: MutableDocumentPath.cpp:115
float get_float_value() const
Returns the value at the previously specified key in the document as a float. If the key was invalid ...
Definition: MutableDocumentPath.cpp:73
void remove() const
Remove a value at the document's key defined by the preceding subscripting.
Definition: MutableDocumentPath.cpp:130
void replace_with_counter(bool is_default=false) const
Replace a value at the document's key defined by the preceding subscripting with a counter.
Definition: MutableDocumentPath.cpp:137
double get_double_value() const
Returns the value at the previously specified key in the document as a double. If the key was invalid...
Definition: MutableDocumentPath.cpp:65
void increment(double amount) const
Increment a counter at the document's key defined by the preceding subscripting. This will only succe...
Definition: MutableDocumentPath.cpp:149
MutableDocumentPath operator[](std::string path)
Used to specify a path to a key in the document that you can subscript further to access a nested key...
Definition: MutableDocumentPath.cpp:37
std::shared_ptr< AttachmentToken > get_attachment_token() const
Returns the value at the previously specified key in the document as a std::shared_ptr<AttachmentToke...
Definition: MutableDocumentPath.cpp:102
void insert(nlohmann::json value) const
Inserts a value into an array at the index defined by the preceding subscripting. This will only succ...
Definition: MutableDocumentPath.cpp:177
basic_json<> json
default JSON class
Definition: json.hpp:2933
An identifier for a Document.
Definition: DocumentId.hpp:21