Skip to content

Commit a4a01ce

Browse files
committed
update server code to work with updated mongoose version
1 parent cee9fa7 commit a4a01ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ require('./config/passport');
122122

123123
// Connect to MongoDB
124124
mongoose.Promise = global.Promise;
125-
mongoose.connect(mongoConnectionString, { useMongoClient: true });
125+
mongoose.connect(mongoConnectionString, { useNewUrlParser: true, useUnifiedTopology: true });
126+
mongoose.set('useCreateIndex', true);
126127
mongoose.connection.on('error', () => {
127128
console.error('MongoDB Connection Error. Please make sure that MongoDB is running.');
128129
process.exit(1);

0 commit comments

Comments
 (0)