0

Here is my code to connect to the mongoose database:

mongoose.connect('mongodb://localhost/statistic_analysis', { useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true })

I passed the useunifiedTopology option as suggested by the command line. But still it gives me the deprecation warning

(node:4594) 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.

I searched high and low applying almost every suggestion I could find. Still gives me the warning. I tried using MongoClient constructor too. Still gives the error. Where am I going wrong?

  • Does this answer your question? [Server Discovery And Monitoring engine is deprecated](https://stackoverflow.com/questions/57895175/server-discovery-and-monitoring-engine-is-deprecated) – Joss Bird Apr 23 '20 at 10:17
  • have you tried adding the port to your mongodb URI? `'mongodb://localhost:27017/statistic_analysis'` – Alexander Riedel Apr 23 '20 at 10:20

0 Answers0