I am using Mongoose with my Node.js app and this is my configuration:
mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopol
use this line, this worked for me
mongoose.set('useUnifiedTopology', true);