From b36a4c0fff73039ea94cbd51846b392a5c7cad58 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Tue, 3 Sep 2019 21:06:53 +0200 Subject: [PATCH] Use update indexes access in Mongoose configuration. Fixes #225 See: https://mongoosejs.com/docs/deprecations.html#ensureindex Thanks! --- src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index d778090..97d7ed3 100644 --- a/src/app.ts +++ b/src/app.ts @@ -30,7 +30,7 @@ const app = express(); const mongoUrl = MONGODB_URI; mongoose.Promise = bluebird; -mongoose.connect(mongoUrl, { useNewUrlParser: true} ).then( +mongoose.connect(mongoUrl, { useNewUrlParser: true, useCreateIndex: true } ).then( () => { /** ready to use. The `mongoose.connect()` promise resolves to undefined. */ }, ).catch(err => { console.log("MongoDB connection error. Please make sure MongoDB is running. " + err);