Ditto  3.0.4
ScopedWriteTransaction.hpp
1 #ifndef _DITTO_SCOPED_WRITE_TRANSACTION_
2 #define _DITTO_SCOPED_WRITE_TRANSACTION_
3 
4 #include "DocumentId.hpp"
5 #include "Helpers.hpp"
6 #include "WriteStrategy.hpp"
7 #include "WriteTransaction.hpp"
8 #include "WriteTransactionPendingCursorOperation.hpp"
9 #include "WriteTransactionPendingIDSpecificOperation.hpp"
10 
11 #include "json.hpp"
12 #include "safer_ffi_utils.hpp"
13 
14 #include <string>
15 
16 namespace ditto {
17 class DittoHandleWrapper;
18 
24  friend class WriteTransaction;
27 
28  WriteTransaction &base_transaction;
29 
31  WriteTransaction &base_transaction);
32 
33 public:
37  std::string collection_name;
38 
50  WriteStrategy write_strategy = WriteStrategy::merge) const;
51 
63 
72 
81  WriteTransactionPendingCursorOperation find(std::string query) const;
82 
103  nlohmann::json query_args) const;
104 };
105 } // namespace ditto
106 #endif
ScopedWriteTransaction exposes functionality that allows you to perform multiple operations on the st...
Definition: ScopedWriteTransaction.hpp:23
WriteTransactionPendingCursorOperation find_all() const
Generates a WriteTransactionPendingCursorOperation that can be used to update, remove or evict docume...
Definition: ScopedWriteTransaction.cpp:40
std::string collection_name
Definition: ScopedWriteTransaction.hpp:37
WriteTransactionPendingCursorOperation find(std::string query, nlohmann::json query_args) const
Generates a WriteTransactionPendingCursorOperation with the provided query that can be used to update...
WriteTransactionPendingIDSpecificOperation find_by_id(DocumentId id) const
Generates a WriteTransactionPendingIDSpecificOperation with the provided document ID that can be used...
Definition: ScopedWriteTransaction.cpp:33
DocumentId upsert(nlohmann::json content, WriteStrategy write_strategy=WriteStrategy::merge) const
Inserts a new document into the collection and returns its ID. If the document already exists,...
Definition: ScopedWriteTransaction.cpp:21
WriteTransactionPendingCursorOperation find(std::string query) const
Generates a WriteTransactionPendingCursorOperation with the provided query that can be used to update...
Definition: ScopedWriteTransaction.cpp:45
WriteTransaction exposes functionality that allows you to perform multiple operations on the store wi...
Definition: WriteTransaction.hpp:25
These objects are returned when using find-like functionality on ScopedWriteTransactions....
Definition: WriteTransactionPendingCursorOperation.hpp:25
These objects are returned when ScopedWriteTransaction::find_by_id is called.
Definition: WriteTransactionPendingIDSpecificOperation.hpp:25
basic_json<> json
default JSON class
Definition: json.hpp:2933
An identifier for a Document.
Definition: DocumentId.hpp:21