mongoose.set("useUnifiedTopology" code example
Example 1: DeprecationWarning: current Server Discovery and Monitoring engine is deprecated,
mongoose.connect(uri, { useNewUrlParser: true,useUnifiedTopology:true });
mongoose.createConnection(uri, { useNewUrlParser: true });
Example 2: deprecationwarning: mongoose
mongoose.connect("mongodb://localhost/test1", { useNewUrlParser: true, useUnifiedTopology: true });
//test1 is databse name