summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/update_driver.cpp
diff options
context:
space:
mode:
authorJunhson Jean-Baptiste <junhson.jean-baptiste@mongodb.com>2020-07-15 20:23:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-04 21:51:57 +0000
commitf1194464424569250152308e3cae1ecbade7fb71 (patch)
treec8dbd00b63823ed35d11a163d5f852458fe47f2d /src/mongo/db/update/update_driver.cpp
parentee837757591fb1f5f4eecd324fd2a8fa56d3a8e4 (diff)
downloadmongo-f1194464424569250152308e3cae1ecbade7fb71.tar.gz
SERVER-49117 Remove storage validation of '$' and '.' in field names for insert and update
Diffstat (limited to 'src/mongo/db/update/update_driver.cpp')
-rw-r--r--src/mongo/db/update/update_driver.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/update/update_driver.cpp b/src/mongo/db/update/update_driver.cpp
index e0cf8dafb4c..91b625ee3ef 100644
--- a/src/mongo/db/update/update_driver.cpp
+++ b/src/mongo/db/update/update_driver.cpp
@@ -312,7 +312,10 @@ void UpdateDriver::setCollator(const CollatorInterface* collator) {
bool UpdateDriver::isDocReplacement(const write_ops::UpdateModification& updateMod) {
return (updateMod.type() == write_ops::UpdateModification::Type::kClassic &&
- *updateMod.getUpdateClassic().firstElementFieldName() != '$') ||
+ (modifiertable::getType(
+ updateMod.getUpdateClassic().firstElementFieldNameStringData()) ==
+ modifiertable::MOD_UNKNOWN &&
+ updateMod.getUpdateClassic().firstElementFieldNameStringData() != "$v"_sd)) ||
updateMod.type() == write_ops::UpdateModification::Type::kPipeline;
}