1
0
Fork 0

Fix output of _id attribute for new documents in smart edge collections.

This commit is contained in:
Max Neunhoeffer 2016-09-28 21:58:31 +02:00
parent a9436e5a83
commit 295ddba918
1 changed files with 11 additions and 1 deletions

View File

@ -1071,7 +1071,17 @@ void Transaction::buildDocumentIdentity(LogicalCollection* collection,
TRI_doc_mptr_t const* newMptr) {
builder.openObject();
if (ServerState::isRunningInCluster(_serverRole)) {
builder.add(StaticStrings::IdString, VPackValue(resolver()->getCollectionName(cid) + "/" + key.toString()));
std::string resolved = resolver()->getCollectionNameCluster(cid);
#ifdef USE_ENTERPRISE
if (resolved.compare(0, 7, "_local_") == 0) {
resolved.erase(0, 7);
} else if (resolved.compare(0, 6, "_from_") == 0) {
resolved.erase(0, 6);
} else if (resolved.compare(0, 4, "_to_") == 0) {
resolved.erase(0,4);
}
#endif
builder.add(StaticStrings::IdString, VPackValue(resolved + "/" + key.toString()));
} else {
builder.add(StaticStrings::IdString,
VPackValue(collection->name() + "/" + key.toString()));