Skip to content

Commit

Permalink
Fix: print 'DeprecationWarning' error
Browse files Browse the repository at this point in the history
  • Loading branch information
KSH-code committed Sep 18, 2018
1 parent 9f86f90 commit 36f42e5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.0.2 / 2018-09-18
================

* __Fix__ #300 DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead
* __Fix__ #297 DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead
2.0.1 / 2018-01-04
================

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MongoDB session store for [Connect](https://github.com/senchalabs/connect) and [
* Support all Connect versions
* Support [Mongoose](http://mongoosejs.com/index.html) `>= 4.1.2+`
* Support [native MongoDB driver](http://mongodb.github.io/node-mongodb-native/) `>= 2.0.36`
* Support Node.js 4, 6 and 8
* Support Node.js 4, 6, 8 and 10
* Support [MongoDB](https://www.mongodb.com/) `>= 3.0`

For extended compatibility, see previous versions.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "connect-mongo",
"version": "2.0.1",
"version": "2.0.2",
"description": "MongoDB session store for Express and Connect",
"keywords": [
"connect",
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ module.exports = function (connect) {
}

return withCallback(this.collectionReady()
.then(collection => collection.update({_id: this.computeStorageId(sid)}, s, {upsert: true}))
.then(collection => collection.updateOne({_id: this.computeStorageId(sid)}, s, {upsert: true}))
.then(rawResponse => {
if (rawResponse.result) {
rawResponse = rawResponse.result
Expand Down Expand Up @@ -280,7 +280,7 @@ module.exports = function (connect) {
}

return withCallback(this.collectionReady()
.then(collection => collection.update({_id: this.computeStorageId(sid)}, {$set: updateFields}))
.then(collection => collection.updateOne({_id: this.computeStorageId(sid)}, {$set: updateFields}))
.then(result => {
if (result.nModified === 0) {
throw new Error('Unable to find the session to touch')
Expand All @@ -293,7 +293,7 @@ module.exports = function (connect) {

destroy(sid, callback) {
return withCallback(this.collectionReady()
.then(collection => collection.remove({_id: this.computeStorageId(sid)}))
.then(collection => collection.deleteOne({_id: this.computeStorageId(sid)}))
.then(() => this.emit('destroy', sid))
, callback)
}
Expand Down

0 comments on commit 36f42e5

Please sign in to comment.