[Solved] eggjs Error: Warning: Current Server Discovery and Monitoring engine is deprecated, and will be rem…

eggjs error: Warning: Current Server Discovery and Monitoring engine is deprecated, and will be rem…

Errors are reported as follows:

Warning: 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

 

 

Cause of error reporting:

Mongoose the old parser is going to be discarded and the new parser should be used

Solution:

Add a configuration in the directory config/config.default.js:

	config.mongoose = {
	    url: 'mongodb://127.0.0.1:27017/userLog',
      options: {
         useUnifiedTopology:true
      },
	};

Read More: