mirror of https://gitee.com/bigwinds/arangodb
Fix output of _id attribute for new documents in smart edge collections.
This commit is contained in:
parent
a9436e5a83
commit
295ddba918
|
@ -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()));
|
||||
|
|
Loading…
Reference in New Issue