Skip to content

Commit

Permalink
Merge pull request #807 from telefonicaid/task/replace_mongo_save_ins…
Browse files Browse the repository at this point in the history
…ertOne

replace deprecated method save to insertOne and remove to deleteOne
  • Loading branch information
fgalan authored Sep 24, 2024
2 parents 1cf840d + da9ce52 commit 496a9e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions lib/models/rulesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 496a9e9

Please sign in to comment.