MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / insert

Method insert

src/ExtMsg.actor.cpp:1433–1442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1431 std::string describe() override { return "SimpleUpsert(" + selector.toString() + "," + update.toString() + ")"; }
1432
1433 Future<Reference<IReadWriteContext>> insert(Reference<CollectionContext> cx) override {
1434 Optional<IdInfo> encodedIds = extractEncodedIds(selector);
1435 Optional<IdInfo> updateIds = extractEncodedIds(update);
1436 if (!encodedIds.present()) {
1437 encodedIds = updateIds;
1438 } else if (updateIds.present() && updateIds.get().keyEncoded != encodedIds.get().keyEncoded) {
1439 throw cant_modify_id();
1440 }
1441 return insertDocument(cx, update, encodedIds);
1442 }
1443};
1444
1445Reference<IUpdateOp> operatorUpdate(bson::BSONObj const& msgUpdate) {

Callers

nothing calls this directly

Calls 2

extractEncodedIdsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected