summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/delete.cpp
diff options
context:
space:
mode:
authorMartin Neupauer <martin.neupauer@mongodb.com>2019-08-29 13:22:09 +0000
committerevergreen <evergreen@mongodb.com>2019-08-29 13:22:09 +0000
commit3cdbdedce431fbc71a5eb89b689268e783d73bd4 (patch)
tree327109bb734c91384f13f5acee6b71c917ea1fd3 /src/mongo/db/exec/delete.cpp
parentffd486c3ff049abc9f8a2c76b3e2b9dea970c19b (diff)
downloadmongo-3cdbdedce431fbc71a5eb89b689268e783d73bd4.tar.gz
SERVER-42181 Make WorkingSetMember hold Document instead of BSONObj
SERVER-42157 Unowned mode for Document/Value
Diffstat (limited to 'src/mongo/db/exec/delete.cpp')
-rw-r--r--src/mongo/db/exec/delete.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp
index 5bfc34510d7..c31ce92b72d 100644
--- a/src/mongo/db/exec/delete.cpp
+++ b/src/mongo/db/exec/delete.cpp
@@ -183,12 +183,11 @@ PlanStage::StageState DeleteStage::doWork(WorkingSetID* out) {
if (_params->returnDeleted) {
// Save a copy of the document that is about to get deleted, but keep it in the RID_AND_OBJ
// state in case we need to retry deleting it.
- BSONObj deletedDoc = member->obj.value();
- member->obj.setValue(deletedDoc.getOwned());
+ member->makeObjOwnedIfNeeded();
}
if (_params->removeSaver) {
- uassertStatusOK(_params->removeSaver->goingToDelete(member->obj.value()));
+ uassertStatusOK(_params->removeSaver->goingToDelete(member->doc.value().toBson()));
}
// TODO: Do we want to buffer docs and delete them in a group rather than saving/restoring state