From 18b740523456a8e1ec73f6bb5a87c21fb4e6a6f6 Mon Sep 17 00:00:00 2001 From: Muhammad Adeel <103568558+adeel-jf@users.noreply.github.com> Date: Fri, 27 May 2022 16:21:46 +0500 Subject: [PATCH] updated mongoose update function to Collection.updateMany Collection.update function is deprecated by mongoose which is causing trouble to update multiple records. Now using Collection.updateMany for updating records in mongoDB. --- lib/task_core/goose.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/task_core/goose.js b/lib/task_core/goose.js index 983771b..49052c7 100644 --- a/lib/task_core/goose.js +++ b/lib/task_core/goose.js @@ -53,7 +53,7 @@ exports.performUpdate = function(db, step, task, results) { doc.isNew = false; update = doc.save(); } - else update = Collection.update(condition, data, step.options).exec(); + else update = Collection.updateMany(condition, data, step.options).exec(); return update.then(function (result) { results.push(result);