1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 16:17:37 +00:00

Use update indexes access in Mongoose configuration. Fixes #225

See: https://mongoosejs.com/docs/deprecations.html#ensureindex

Thanks!
This commit is contained in:
Peter Blazejewicz
2019-09-03 21:06:53 +02:00
parent f01569a301
commit b36a4c0fff

View File

@@ -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);