1#ifndef DITTO_PENDING_ID_SPECIFIC_OPERATION_H
2#define DITTO_PENDING_ID_SPECIFIC_OPERATION_H
5#include "DocumentId.hpp"
7#include "LiveQuery.hpp"
8#include "MutableDocument.hpp"
9#include "Subscription.hpp"
10#include "UpdateResult.hpp"
43class DITTO_DEPRECATED_BECAUSE(
44 "Use DQL (Ditto Query Language) instead. For more information see: "
45 "https://ditto.com/link/legacy-to-dql-guide") PendingIDSpecificOperation {
46 DITTO_DISABLE_DEPRECATED_WARNINGS(
"The legacy query API is deprecated")
48 friend class Collection;
50 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
53 PendingIDSpecificOperation(
54 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
57 std::shared_ptr<LiveQuery> observe_internal(
58 std::unique_ptr<Subscription> &&subscription,
59 LiveQueryAvailability_t availability,
62 std::shared_ptr<LiveQuery> observe_internal(
63 std::unique_ptr<Subscription> &&subscription,
64 LiveQueryAvailability_t availability,
87 std::shared_ptr<Document>
exec()
const;
102 DITTO_DEPRECATED_BECAUSE(
"Use `update_v2` instead.")
200 DITTO_REENABLE_WARNINGS
The type that is returned when calling observe_local. It handles the logic for calling the event hand...
Definition LiveQuery.hpp:149
This is used as part of update operations for documents.
Definition MutableDocument.hpp:34
bool remove() const
Remove the document with the matching ID.
std::shared_ptr< Document > exec() const
Execute the find operation to return the document with the matching ID.
std::shared_ptr< Subscription > subscribe() const
Subscribe to changes from other peers that occur in relation to the relevant document.
DocumentId id
Definition PendingIDSpecificOperation.hpp:78
std::vector< std::unique_ptr< UpdateResult > > update_v2(std::function< void(MutableDocument *)> fn)
Update the document with the matching ID using the provided function.
std::shared_ptr< LiveQuery > observe_local(SingleDocumentLiveQueryEventCallback event_callback) const
Enables you to listen for changes that occur locally in relation to the relevant document.
std::string collection_name
Definition PendingIDSpecificOperation.hpp:72
std::vector< std::unique_ptr< UpdateResult > > update(std::function< void(MutableDocument &)> fn)
Update the document with the matching ID using the provided function.
bool evict() const
Evict the document with the matching ID.
std::shared_ptr< LiveQuery > observe_local_with_next_signal(SingleDocumentLiveQueryEventWithNextSignalCallback event_callback) const
Enables you to listen for changes that occur locally in relation to the relevant document,...
While Subscription objects remain in scope they ensure that documents in the collection specified,...
Definition Subscription.hpp:26
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19
std::function< void(std::shared_ptr< Document >, SingleDocumentLiveQueryEvent)> SingleDocumentLiveQueryEventCallback
A function that will get called when there are updates relating to a live query associated with a sin...
Definition LiveQuery.hpp:32
std::function< void(std::shared_ptr< Document >, SingleDocumentLiveQueryEvent, std::function< void()> &)> SingleDocumentLiveQueryEventWithNextSignalCallback
A function that will get called when there are updates relating to a live query associated with a sin...
Definition LiveQuery.hpp:59
An identifier for a Document.
Definition DocumentId.hpp:23
A thin wrapper around a function that will get called when there are updates relating to a live query...
Definition LiveQuery.hpp:75
Provides information about a successful update operation on a document.
Definition UpdateResult.hpp:35