Make connect-mongo compatible with newer mongodb and mongoose

This commit is contained in:
Michal Miszczyszyn
2019-02-19 19:52:34 +01:00
parent 90961b6110
commit a437cfbec7
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ app.use(session({
// NativeMongoPromiseOptions
var Client = mongodb.MongoClient;
var mongoDbPromise = Client.connect('mongodb://localhost/test');
var mongoDbPromise = Client.connect('mongodb://localhost/test').then(client => client.db())
app.use(session({
secret: 'secret',
store: new MongoStore({ dbPromise: mongoDbPromise})
store: new MongoStore({ dbPromise: mongoDbPromise })
}));
+2 -2
View File
@@ -6,10 +6,10 @@
],
"paths": {
"mongodb": [
"mongodb/v2"
"mongodb"
],
"mongoose": [
"mongoose/v4"
"mongoose"
]
},
"noImplicitAny": true,