From a437cfbec7735ba0c930a8a21ae20833adedb3ad Mon Sep 17 00:00:00 2001 From: Michal Miszczyszyn Date: Tue, 19 Feb 2019 19:52:34 +0100 Subject: [PATCH 1/2] Make connect-mongo compatible with newer mongodb and mongoose --- types/connect-mongo/connect-mongo-tests.ts | 4 ++-- types/connect-mongo/tsconfig.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/connect-mongo/connect-mongo-tests.ts b/types/connect-mongo/connect-mongo-tests.ts index 351975d84c..4e3c7f8381 100644 --- a/types/connect-mongo/connect-mongo-tests.ts +++ b/types/connect-mongo/connect-mongo-tests.ts @@ -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 }) })); diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index c0c9ab3043..45b5d1d665 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -6,10 +6,10 @@ ], "paths": { "mongodb": [ - "mongodb/v2" + "mongodb" ], "mongoose": [ - "mongoose/v4" + "mongoose" ] }, "noImplicitAny": true, From 4257e8e1cd57626ee3f0e0aec1f2303cf733a8a7 Mon Sep 17 00:00:00 2001 From: Michal Miszczyszyn Date: Tue, 19 Feb 2019 20:29:52 +0100 Subject: [PATCH 2/2] Fix mappings --- types/connect-mongo/tsconfig.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index 45b5d1d665..dc0b76551d 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -4,14 +4,6 @@ "lib": [ "es6" ], - "paths": { - "mongodb": [ - "mongodb" - ], - "mongoose": [ - "mongoose" - ] - }, "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false,