Ditto
1.0.14
|
These objects are returned when ScopedWriteTransaction::find_by_id is called. More...
Public Member Functions | |
std::shared_ptr< Document > | exec () |
Execute the find operation to return the document with the matching ID, if it exists. More... | |
std::vector< std::unique_ptr< UpdateResult > > | update (std::function< void(MutableDocument &)> fn) |
Update the document with the matching ID. More... | |
bool | remove () |
Remove the document with the matching ID. More... | |
bool | evict () |
Evict the document with the matching ID. More... | |
Public Attributes | |
std::string | collection_name |
DocumentId | document_id |
These objects are returned when ScopedWriteTransaction::find_by_id is called.
You can use them to perform updates on a document and remove or evict a document.
bool ditto::WriteTransactionPendingIDSpecificOperation::evict | ( | ) |
Evict the document with the matching ID.
true
if the document was found and evicted. false
if the document wasn't found and therefore wasn't evicted. std::shared_ptr< Document > ditto::WriteTransactionPendingIDSpecificOperation::exec | ( | ) |
Execute the find operation to return the document with the matching ID, if it exists.
Document
with the ID provided in the ScopedWriteTransaction::find_by_id call or nullptr
if the document was not found. bool ditto::WriteTransactionPendingIDSpecificOperation::remove | ( | ) |
Remove the document with the matching ID.
true
if the document was found and removed. false
if the document wasn't found and therefore wasn't removed. std::vector< std::unique_ptr< UpdateResult > > ditto::WriteTransactionPendingIDSpecificOperation::update | ( | std::function< void(MutableDocument &)> | fn | ) |
Update the document with the matching ID.
fn | a lambda that gets called with the document matching the ID. If found, the document is a MutableDocument , so you can call update-related functions on it. If the document is not found then the value provided to the closure will be nullptr . |
UpdateResult
that describes the updates that were performed on the document. std::string ditto::WriteTransactionPendingIDSpecificOperation::collection_name |
The name of the collection that the operation will be performed within.
DocumentId ditto::WriteTransactionPendingIDSpecificOperation::document_id |
The ID of the document that the operation will apply to.