1mongoose.connect(process.env.DATABASE, {
2 useNewUrlParser: true,
3 useCreateIndex: true,
4 useFindAndModify: false,
5 useUnifiedTopology: true,
6})
7.then(() => {
8 console.log("DB connected");
9})
10.catch((err) => console.log(`DB connection Err`, err));
1mongoose.set('useNewUrlParser', true);
2mongoose.set('useFindAndModify', false);
3mongoose.set('useCreateIndex', true);
4mongoose.set('useUnifiedTopology', true);