{ useUnifiedTopology: true } code example
Example 1: DeprecationWarning: current Server Discovery and Monitoring engine is deprecated,
mongoose.connect("paste db link", {useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true });
Example 2: { useUnifiedTopology: true }
// for depreacation warning and suggestion to include { useUnifiedTopology: true }
const mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/dbName", {
useNewUrlParser:true,
useUnifiedTopology: true
});