I am using Mongoose with my Node.js app and this is my configuration:
mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopol
mongoose.connect("DBURL", {useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true },(err)=>{ if(!err){ console.log('MongoDB connection sucess'); } else{ console.log('connection not established :' + JSON.stringify(err,undefined,2)); } });