Ditto 3.0.8
UpdateResult.hpp
1#ifndef _DITTO_UPDATE_RESULT_
2#define _DITTO_UPDATE_RESULT_
3
4#include "DocumentId.hpp"
5
6#include "json.hpp"
7
8#include <string>
9
10namespace ditto {
11
22enum class UpdateResultType {
23 Set,
24 Removed,
25 Incremented,
26 ReplacedText,
27};
28
34 friend struct UpdateResultSet;
35 friend struct UpdateResultRemoved;
37 friend struct UpdateResultIncremented;
38
43
48 std::string path;
49
53 UpdateResultType type;
54
55 virtual ~UpdateResult() = default;
56
57private:
58 UpdateResult(DocumentId document_id, std::string path, UpdateResultType type);
59};
60
66 friend class MutableDocumentPath;
67
72
73private:
76};
77
83 friend class MutableDocumentPath;
84
85private:
87};
88
94 friend class MutableDocumentPath;
95
96private:
98};
99
105 friend class MutableDocumentPath;
106
110 double amount;
111
112private:
114 double amount);
115};
116
117} // namespace ditto
118
119#endif
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition: MutableDocumentPath.hpp:32
basic_json<> json
default JSON class
Definition: json.hpp:2933
An identifier for a Document.
Definition: DocumentId.hpp:21
Provides information about a successful update operation on a document.
Definition: UpdateResult.hpp:33
std::string path
Definition: UpdateResult.hpp:48
UpdateResultType type
Definition: UpdateResult.hpp:53
DocumentId document_id
Definition: UpdateResult.hpp:42
An update result when the update result's type is UpdateResultType::Incremented.
Definition: UpdateResult.hpp:104
double amount
Definition: UpdateResult.hpp:110
An update result when the update result's type is UpdateResultType::Removed.
Definition: UpdateResult.hpp:82
An update result when the update result's type is UpdateResultType::ReplacedWithCounter.
Definition: UpdateResult.hpp:93
An update result when the update result's type is UpdateResultType::Set.
Definition: UpdateResult.hpp:65
nlohmann::json value
Definition: UpdateResult.hpp:71