diff options
Diffstat (limited to 'src/mongo/db/pipeline/process_interface_standalone.cpp')
-rw-r--r-- | src/mongo/db/pipeline/process_interface_standalone.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/db/pipeline/process_interface_standalone.cpp b/src/mongo/db/pipeline/process_interface_standalone.cpp index 5607f42279d..c26d1642b1d 100644 --- a/src/mongo/db/pipeline/process_interface_standalone.cpp +++ b/src/mongo/db/pipeline/process_interface_standalone.cpp @@ -187,7 +187,7 @@ Update MongoInterfaceStandalone::buildUpdateOp( const boost::intrusive_ptr<ExpressionContext>& expCtx, const NamespaceString& nss, BatchedObjects&& batch, - bool upsert, + UpsertType upsert, bool multi) { Update updateOp(nss); updateOp.setUpdates([&] { @@ -199,7 +199,9 @@ Update MongoInterfaceStandalone::buildUpdateOp( entry.setQ(std::move(q)); entry.setU(std::move(u)); entry.setC(std::move(c)); - entry.setUpsert(upsert); + entry.setUpsert(upsert != UpsertType::kNone); + entry.setUpsertSupplied( + {{entry.getUpsert(), upsert == UpsertType::kInsertSuppliedDoc}}); entry.setMulti(multi); return entry; }()); @@ -238,7 +240,7 @@ StatusWith<MongoProcessInterface::UpdateResult> MongoInterfaceStandalone::update const NamespaceString& ns, BatchedObjects&& batch, const WriteConcernOptions& wc, - bool upsert, + UpsertType upsert, bool multi, boost::optional<OID> targetEpoch) { auto writeResults = |