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

Function staticValidateModifiedFields

src/ExtMsg.actor.cpp:946–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

944}
945
946void staticValidateModifiedFields(std::string fieldName,
947 std::set<std::string>* affectedFields,
948 std::set<std::string>* prefixesOfAffectedFields) {
949 if (affectedFields->find(fieldName) != affectedFields->end())
950 throw field_name_duplication_with_mods();
951 if (prefixesOfAffectedFields->find(fieldName) != prefixesOfAffectedFields->end())
952 throw conflicting_mods_in_update();
953 affectedFields->insert(fieldName);
954 auto upOneFn = upOneLevel(fieldName);
955 if (!upOneFn.empty()) {
956 while (!upOneFn.empty()) {
957 if (affectedFields->find(upOneFn) != affectedFields->end())
958 throw conflicting_mods_in_update();
959 prefixesOfAffectedFields->insert(upOneFn);
960 upOneFn = upOneLevel(upOneFn);
961 }
962 }
963}
964
965std::vector<std::string> staticValidateUpdateObject(bson::BSONObj update, bool multi, bool upsert) {
966 std::set<std::string> affectedFields;

Callers 1

Calls 5

upOneLevelFunction · 0.85
findMethod · 0.80
endMethod · 0.80
emptyMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected