Ditto 4.13.1
 
Loading...
Searching...
No Matches
Document.hpp
1#ifndef DITTO_DOCUMENT_H
2#define DITTO_DOCUMENT_H
3
4#include "DocumentId.hpp"
5#include "DocumentPath.hpp"
6
7#include "json.hpp"
8
9using CDocument_t = struct CDocument;
10
11namespace ditto {
12
20class DITTO_DEPRECATED_BECAUSE(
21 "Use DQL (Ditto Query Language) instead. For more information "
22 "see: https://ditto.com/link/legacy-to-dql-guide") Document {
23 DITTO_DISABLE_DEPRECATED_WARNINGS("The legacy query API is deprecated")
24 friend class DocumentHelpers;
25 friend class DocumentOperator;
26 friend class LiveQuery;
27 friend class QueryOperator;
28 friend class PendingIDSpecificOperation;
29 friend class PendingCursorOperation;
30
31 CDocument_t *document;
32
33 explicit Document(CDocument_t *document);
34
35public:
36 Document(const Document &) = delete;
37 Document(Document &&) noexcept;
38 ~Document();
39
45 DocumentId id() const;
46
52 nlohmann::json value() const;
53
64 DocumentPath operator[](std::string initial_path);
65
66 DITTO_REENABLE_WARNINGS
67};
68} // namespace ditto
69
70#endif
nlohmann::json value() const
Get the document's inner value.
DocumentId id() const
Get the ID of the document.
DocumentPath operator[](std::string initial_path)
Used to specify a path to a key in the document that you can subscript further to access a nested key...
Provides an interface to specify a path to a key in a document that you can then call a function on t...
Definition DocumentPath.hpp:36
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19
An identifier for a Document.
Definition DocumentId.hpp:23