diff --git a/index.js b/index.js index 3238d8bf..ecfd044c 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,13 @@ mongoose.Promise = Promise; // connect to mongo db const mongoUri = config.mongo.host; -mongoose.connect(mongoUri, { server: { socketOptions: { keepAlive: 1 } } }); +mongoose.connect(mongoUri, { + keepAlive: true, + useNewUrlParser: true, + useCreateIndex: true, + useFindAndModify: false +}); + mongoose.connection.on('error', () => { throw new Error(`unable to connect to database: ${mongoUri}`); });