summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/update.cpp
diff options
context:
space:
mode:
authorMinji <minjikim0202@gmail.com>2018-06-18 15:03:24 -0400
committerMinji <minjikim0202@gmail.com>2018-06-29 13:33:23 -0400
commit77d35b732b4aa312ba7dd3505dd90fbfe9b6753e (patch)
treeb9fcd89b7ebd001aaf9c37398a7014ffdca0362e /src/mongo/db/ops/update.cpp
parenta3f0ad233bab0f49ae19bbc14468c4b600ec794e (diff)
downloadmongo-77d35b732b4aa312ba7dd3505dd90fbfe9b6753e.tar.gz
SERVER-32348 Make UpdateDriver::parse() throw an exception instead of returning error Status
Diffstat (limited to 'src/mongo/db/ops/update.cpp')
-rw-r--r--src/mongo/db/ops/update.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mongo/db/ops/update.cpp b/src/mongo/db/ops/update.cpp
index 85664098e4d..4cacd35d047 100644
--- a/src/mongo/db/ops/update.cpp
+++ b/src/mongo/db/ops/update.cpp
@@ -114,19 +114,14 @@ BSONObj applyUpdateOperators(OperationContext* opCtx,
boost::intrusive_ptr<ExpressionContext> expCtx(new ExpressionContext(opCtx, collator));
UpdateDriver driver(std::move(expCtx));
std::map<StringData, std::unique_ptr<ExpressionWithPlaceholder>> arrayFilters;
- Status status = driver.parse(operators, arrayFilters);
- if (!status.isOK()) {
- uasserted(16838, status.reason());
- }
+ driver.parse(operators, arrayFilters);
mutablebson::Document doc(from, mutablebson::Document::kInPlaceDisabled);
const bool validateForStorage = false;
const FieldRefSet emptyImmutablePaths;
- status = driver.update(StringData(), &doc, validateForStorage, emptyImmutablePaths);
- if (!status.isOK()) {
- uasserted(16839, status.reason());
- }
+
+ uassertStatusOK(driver.update(StringData(), &doc, validateForStorage, emptyImmutablePaths));
return doc.getObject();
}