Ditto 4.13.1
 
Loading...
Searching...
No Matches
DocumentIdPath.hpp
1#ifndef DITTO_DOCUMENT_ID_PATH_H
2#define DITTO_DOCUMENT_ID_PATH_H
3
4#include "document_path_component.hpp"
5
6#include "Helpers.hpp"
7#include "json.hpp"
8
9#include <string>
10#include <vector>
11
12namespace ditto {
13
26class DITTO_DEPRECATED_BECAUSE(
27 "Use DQL (Ditto Query Language) instead. For more information "
28 "see: https://ditto.com/link/legacy-to-dql-guide") DocumentIdPath {
29 friend struct DocumentId;
30
31private:
32 nlohmann::json value;
33 std::vector<DocumentPathComponent> path_components;
34
42 DocumentIdPath(nlohmann::json value, DocumentPathComponent initial_path);
43
53 DocumentIdPath(const DocumentIdPath *document_id_path, std::string key);
54
63 DocumentIdPath(const DocumentIdPath *document_id_path, std::size_t index);
64
65public:
66 DocumentIdPath operator[](std::string key);
67 DocumentIdPath operator[](std::size_t index);
68
78 std::string get_string_value() const;
79
88 int get_int_value() const;
89
99 double get_double_value() const;
100
109 float get_float_value() const;
110
120 bool get_bool_value() const;
121
131 nlohmann::json get_json() const;
132};
133} // namespace ditto
134
135#endif
double get_double_value() const
Returns the value at the previously specified key in the document ID as a double. If the key was inva...
float get_float_value() const
Returns the value at the previously specified key in the document ID as a float. If the key was inval...
int get_int_value() const
Returns the value at the previously specified key in the document ID as an int. If the key was invali...
nlohmann::json get_json() const
Returns the value at the previously specified key in the document ID as a nlohmann::json object....
bool get_bool_value() const
Returns the value at the previously specified key in the document ID as a bool. If the key was invali...
std::string get_string_value() const
Returns the value at the previously specified key in the document ID as a std::string....
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19