Make sure our mutated options object makes into the actual collection method

This commit is contained in:
Emily Stark
2013-09-27 15:10:18 -07:00
parent ff143f94b7
commit bc3ea63752

View File

@@ -375,7 +375,8 @@ _.each(["insert", "update", "remove", "upsert"], function (name) {
args[0] = Meteor.Collection._rewriteSelector(args[0]);
if (name === "update") {
var options = _.clone(args[2]) || {};
// Mutate args but copy the original options object.
var options = args[2] = _.clone(args[2]) || {};
if (isUpsert)
options.upsert = true;
if (options && options.upsert) {