1#ifndef _DITTO_PENDING_CURSOR_OPERATION_
2#define _DITTO_PENDING_CURSOR_OPERATION_
5#include "DocumentId.hpp"
7#include "LiveQuery.hpp"
8#include "MutableDocument.hpp"
9#include "SortDirection.hpp"
10#include "Subscription.hpp"
11#include "UpdateResult.hpp"
17#include <unordered_map>
21class DittoHandleWrapper;
53 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
63 std::unique_ptr<Impl> impl_;
86 swap(first.query_args, second.query_args);
87 swap(first._offset, second._offset);
88 swap(first._limit, second._limit);
89 swap(first.impl_, second.impl_);
142 std::vector<Document>
exec()
const;
154 std::unordered_map<DocumentId, std::vector<std::unique_ptr<UpdateResult>>,
156 update(std::function<
void(std::vector<MutableDocument> &)> fn);
164 std::vector<DocumentId>
remove()
const;
172 std::vector<DocumentId>
evict()
const;
187 std::shared_ptr<Subscription>
subscribe()
const;
207 std::shared_ptr<LiveQuery>
230 LiveQueryEventWithNextSignalCallback event_callback)
const;
A reference to a collection in a Store.
Definition: Collection.hpp:26
These objects are returned when calling collections() on Store objects.
Definition: PendingCollectionsOperation.hpp:58
These objects are returned when using find-like functionality on Collection objects.
Definition: PendingCursorOperation.hpp:44
std::string query
Definition: PendingCursorOperation.hpp:74
std::vector< Document > exec() const
Execute the query generated by the preceding function chaining and return the list of matching docume...
Definition: PendingCursorOperation.cpp:83
PendingCursorOperation & limit(uint32_t limit)
Limit the number of documents that get returned when querying a collection for matching documents.
Definition: PendingCursorOperation.cpp:111
std::shared_ptr< LiveQuery > observe_local_with_next_signal(LiveQueryEventWithNextSignalCallback event_callback) const
Enables you to listen for changes that occur on a collection and match the specified query and qualif...
Definition: PendingCursorOperation.cpp:98
PendingCursorOperation & sort(std::string query, SortDirection direction)
Sort the documents that match the query provided in the preceding find-like function call.
Definition: PendingCursorOperation.cpp:116
PendingCursorOperation & offset(uint32_t offset)
Offset the resulting set of matching documents.
Definition: PendingCursorOperation.cpp:106
std::vector< DocumentId > remove() const
Remove all documents that match the query generated by the preceding function chaining.
Definition: PendingCursorOperation.cpp:141
std::shared_ptr< Subscription > subscribe() const
Subscribe to changes from other peers that occur in the collection.
Definition: PendingCursorOperation.cpp:169
std::vector< DocumentId > evict() const
Evict all documents that match the query generated by the preceding function chaining.
Definition: PendingCursorOperation.cpp:155
std::string collection_name
Definition: PendingCursorOperation.hpp:69
std::shared_ptr< LiveQuery > observe_local(LiveQueryEventCallback event_callback) const
Enables you to listen for changes that occur on a collection and match the specified query and qualif...
Definition: PendingCursorOperation.cpp:89
std::unordered_map< DocumentId, std::vector< std::unique_ptr< UpdateResult > >, DocumentIdHasher > update(std::function< void(std::vector< MutableDocument > &)> fn)
Update documents that match the query generated by the preceding function chaining.
Definition: PendingCursorOperation.cpp:124
basic_json<> json
default JSON class
Definition: json.hpp:2933