diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 267d2503..969251fd 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,3 @@ +- Fix: deprecated mongo warnings about save and remove methods (#806) - Upgrade express from 4.19.2 to 4.20.0 - Upgrade body-parser dep from 1.18.2 to 1.20.3 diff --git a/lib/models/rulesStore.js b/lib/models/rulesStore.js index 2926f2b9..1c3134fd 100644 --- a/lib/models/rulesStore.js +++ b/lib/models/rulesStore.js @@ -155,7 +155,7 @@ module.exports = { [ db.collection.bind(db, rulesCollectionName, { strict: true }), function(col, cb) { - col.remove({ name: rule.name, subservice: rule.subservice, service: rule.service }, cb); + col.deleteOne({ name: rule.name, subservice: rule.subservice, service: rule.service }, cb); } ], function(err, result) { @@ -172,7 +172,7 @@ module.exports = { [ db.collection.bind(db, rulesCollectionName, { strict: true }), function(col, cb) { - col.save(r, cb); + col.insertOne(r, cb); } ], function(err, result) {