mirror of https://gitee.com/bigwinds/arangodb
Added debug output and stub for replace
This commit is contained in:
parent
68a81872f0
commit
2fec9dbef6
|
@ -581,6 +581,13 @@ OperationResult Transaction::insertLocal(std::string const& collectionName,
|
||||||
return OperationResult(TRI_ERROR_NO_ERROR, resultBuilder.steal());
|
return OperationResult(TRI_ERROR_NO_ERROR, resultBuilder.steal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OperationResult Transaction::replace(std::string const& collectionName,
|
||||||
|
VPackSlice const& oldValue,
|
||||||
|
VPackSlice const& updateValue,
|
||||||
|
OperationOptions const& options) {
|
||||||
|
THROW_ARANGO_EXCEPTION(TRI_ERROR_NOT_IMPLEMENTED);
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief update/patch one or multiple documents in a collection
|
/// @brief update/patch one or multiple documents in a collection
|
||||||
/// the single-document variant of this operation will either succeed or,
|
/// the single-document variant of this operation will either succeed or,
|
||||||
|
@ -690,6 +697,7 @@ OperationResult Transaction::removeCoordinator(std::string const& collectionName
|
||||||
/// if it fails, clean up after itself
|
/// if it fails, clean up after itself
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
OperationResult Transaction::removeLocal(std::string const& collectionName,
|
OperationResult Transaction::removeLocal(std::string const& collectionName,
|
||||||
VPackSlice const& value,
|
VPackSlice const& value,
|
||||||
OperationOptions const& options) {
|
OperationOptions const& options) {
|
||||||
|
@ -714,7 +722,7 @@ OperationResult Transaction::removeLocal(std::string const& collectionName,
|
||||||
if (!k.isString()) {
|
if (!k.isString()) {
|
||||||
return OperationResult(TRI_ERROR_ARANGO_DOCUMENT_KEY_BAD);
|
return OperationResult(TRI_ERROR_ARANGO_DOCUMENT_KEY_BAD);
|
||||||
}
|
}
|
||||||
builder.add(TRI_VOC_ATTRIBUTE_KEY, value);
|
builder.add(TRI_VOC_ATTRIBUTE_KEY, k);
|
||||||
|
|
||||||
VPackSlice r = value.get(TRI_VOC_ATTRIBUTE_REV);
|
VPackSlice r = value.get(TRI_VOC_ATTRIBUTE_REV);
|
||||||
if (!r.isNone()) {
|
if (!r.isNone()) {
|
||||||
|
@ -734,6 +742,8 @@ OperationResult Transaction::removeLocal(std::string const& collectionName,
|
||||||
builder.close();
|
builder.close();
|
||||||
|
|
||||||
VPackSlice removeSlice = builder.slice();
|
VPackSlice removeSlice = builder.slice();
|
||||||
|
std::cout << removeSlice.toJson() << "\n";
|
||||||
|
std::cout << expectedRevision << " <- Revision" << "\n";
|
||||||
|
|
||||||
TRI_voc_rid_t actualRevision = 0;
|
TRI_voc_rid_t actualRevision = 0;
|
||||||
TRI_doc_update_policy_t updatePolicy(expectedRevision == 0 ? TRI_DOC_UPDATE_LAST_WRITE : TRI_DOC_UPDATE_ERROR, expectedRevision, &actualRevision);
|
TRI_doc_update_policy_t updatePolicy(expectedRevision == 0 ? TRI_DOC_UPDATE_LAST_WRITE : TRI_DOC_UPDATE_ERROR, expectedRevision, &actualRevision);
|
||||||
|
|
Loading…
Reference in New Issue