Don't modify the input variables when creating upsert document

This commit is contained in:
seke
2017-06-23 13:51:30 +02:00
committed by Ben Newman
parent 8a7db6bdc5
commit 12d03f2607

View File

@@ -1156,6 +1156,7 @@ LocalCollection._createUpsertDocument = function (selector, modifier) {
return newDoc
} else {
// Replacement can take _id from query document
modifier = EJSON.clone(modifier);
if (newDoc._id) {
modifier._id = newDoc._id;
}