summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/parsed_update.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/ops/parsed_update.cpp')
-rw-r--r--src/mongo/db/ops/parsed_update.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/ops/parsed_update.cpp b/src/mongo/db/ops/parsed_update.cpp
index 948aa775084..8570ee212d8 100644
--- a/src/mongo/db/ops/parsed_update.cpp
+++ b/src/mongo/db/ops/parsed_update.cpp
@@ -42,6 +42,10 @@ namespace mongo {
_canonicalQuery() { }
Status ParsedUpdate::parseRequest() {
+ // It is invalid to request that the update plan stores a copy of the resulting document
+ // if it is a multi-update.
+ invariant(!(_request->shouldStoreResultDoc() && _request->isMulti()));
+
// We parse the update portion before the query portion because the dispostion of the update
// may determine whether or not we need to produce a CanonicalQuery at all. For example, if
// the update involves the positional-dollar operator, we must have a CanonicalQuery even if