Skip to content

Commit

Permalink
Merge 0fae7c0 into 9f86f90
Browse files Browse the repository at this point in the history
  • Loading branch information
guyellis committed Sep 17, 2018
2 parents 9f86f90 + 0fae7c0 commit f152270
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
2.0.2 / 2018-09-13
================

* __Fix__ #297 DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead (guyellis)

2.0.1 / 2018-01-04
================

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -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
4 changes: 2 additions & 2 deletions src/index.js
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 Down
2 changes: 1 addition & 1 deletion test/events.js
Expand Up @@ -34,7 +34,7 @@ describe('Events', () => {
done()
})
store.set('foo1', {foo: 'bar'}, noop)
})
}).timeout(10000);
it('should emit a `set` event', done => {
store.once('set', sid => {
expect(sid).to.be('foo2')
Expand Down

0 comments on commit f152270

Please sign in to comment.