From 49e81f02eba0f46da90eed524c3979f7f1fab125 Mon Sep 17 00:00:00 2001 From: MarkovSergii Date: Thu, 19 Jul 2018 09:50:58 +0300 Subject: [PATCH] fix bulkUpdate --- lib/persisted-model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/persisted-model.js b/lib/persisted-model.js index 367e27a9..65ec8524 100644 --- a/lib/persisted-model.js +++ b/lib/persisted-model.js @@ -1440,7 +1440,7 @@ module.exports = function(registry) { switch (update.type) { case Change.UPDATE: tasks.push(function(cb) { - applyUpdate(Model, id, current, update.data, update.change, conflicts, options, cb); + applyUpdate(Model, id, {_id:current.id || current._id}, update.data, update.change, conflicts, options, cb); }); break; @@ -1451,7 +1451,7 @@ module.exports = function(registry) { break; case Change.DELETE: tasks.push(function(cb) { - applyDelete(Model, id, current, update.change, conflicts, options, cb); + applyDelete(Model, id, {_id:current.id || current._id}, update.change, conflicts, options, cb); }); break; }