Ditto 4.9.4
 
Loading...
Searching...
No Matches
WriteTransactionPendingIDSpecificOperation.hpp
1#ifndef _DITTO_WRITE_TRANSACTION_PENDING_ID_SPECIFIC_OPERATION_
2#define _DITTO_WRITE_TRANSACTION_PENDING_ID_SPECIFIC_OPERATION_
3
4#include "Document.hpp"
5#include "DocumentId.hpp"
6#include "MutableDocument.hpp"
7#include "UpdateResult.hpp"
8#include "WriteTransaction.hpp"
9
10#include <functional>
11#include <memory>
12#include <string>
13#include <vector>
14
15namespace ditto {
16class DittoHandleWrapper;
17
25class WriteTransactionPendingIDSpecificOperation {
26 friend class ScopedWriteTransaction;
27
28 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
29 WriteTransaction &base_transaction;
30
31 WriteTransactionPendingIDSpecificOperation(
33 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
34 WriteTransaction &base_transaction);
35
36public:
40 std::string collection_name;
41
46
55 std::shared_ptr<Document> exec() const;
56
70 DITTO_DEPRECATED_BECAUSE("Use `update_v2` instead.")
71 std::vector<std::unique_ptr<UpdateResult>>
72 update(std::function<void(MutableDocument &)> fn) const;
73
84 std::vector<std::unique_ptr<UpdateResult>>
85 update_v2(std::function<void(MutableDocument *)> fn) const;
86
93 bool remove() const;
94
101 bool evict() const;
102};
103} // namespace ditto
104#endif
This is used as part of update operations for documents.
Definition MutableDocument.hpp:29
WriteTransaction exposes functionality that allows you to perform multiple operations on the store wi...
Definition WriteTransaction.hpp:25
bool remove() const
Remove the document with the matching ID.
Definition WriteTransactionPendingIDSpecificOperation.cpp:50
bool evict() const
Evict the document with the matching ID.
Definition WriteTransactionPendingIDSpecificOperation.cpp:61
std::shared_ptr< Document > exec() const
Execute the find operation to return the document with the matching ID, if it exists.
Definition WriteTransactionPendingIDSpecificOperation.cpp:22
std::string collection_name
Definition WriteTransactionPendingIDSpecificOperation.hpp:40
DocumentId document_id
Definition WriteTransactionPendingIDSpecificOperation.hpp:45
std::vector< std::unique_ptr< UpdateResult > > update(std::function< void(MutableDocument &)> fn) const
Update the document with the matching ID.
Definition WriteTransactionPendingIDSpecificOperation.cpp:28
std::vector< std::unique_ptr< UpdateResult > > update_v2(std::function< void(MutableDocument *)> fn) const
Update the document with the matching ID.
Definition WriteTransactionPendingIDSpecificOperation.cpp:39
An identifier for a Document.
Definition DocumentId.hpp:21
Provides information about a successful update operation on a document.
Definition UpdateResult.hpp:30