Solution for "DeprecationWarning: current Server Discovery and Monitoring engine is deprecated,"

mongoose.connect("paste db link", {useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true });

DeprecationWarning: current Server Discovery and Monitoring engine is deprecated,

mongoose.connect(uri, { useNewUrlParser: true,useUnifiedTopology:true }); mongoose.createConnection(uri, { useNewUrlParser: true });

DeprecationWarning: current Server Discovery and Monitoring engine is deprecated,

mongoose.connect(mongoConnectionString, {useNewUrlParser: true, useUnifiedTopology: true});

DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

Similar Code Examples