update server code to work with updated mongoose version

This commit is contained in:
Cassie Tarakajian 2019-11-07 13:38:02 -05:00
parent cee9fa7441
commit a4a01cef4c

View file

@ -122,7 +122,8 @@ require('./config/passport');
// Connect to MongoDB // Connect to MongoDB
mongoose.Promise = global.Promise; mongoose.Promise = global.Promise;
mongoose.connect(mongoConnectionString, { useMongoClient: true }); mongoose.connect(mongoConnectionString, { useNewUrlParser: true, useUnifiedTopology: true });
mongoose.set('useCreateIndex', true);
mongoose.connection.on('error', () => { mongoose.connection.on('error', () => {
console.error('MongoDB Connection Error. Please make sure that MongoDB is running.'); console.error('MongoDB Connection Error. Please make sure that MongoDB is running.');
process.exit(1); process.exit(1);