Hello I am working with a mongo connection but I get the following warning:
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.
The solution is to add the new option but I'm not sure where, so it is possible in any of the following places:
- /lib/databases/mongodb.js
var defaultOpt = {
ssl: false,
useUnifiedTopology: true, // <--- Option 1 for remove warning
};
- /lib/databases/mongodb.js
if (isNew) {
defaultOpt.autoReconnect = false;
defaultOpt.useNewUrlParser = true;
defaultOpt.useUnifiedTopology = true; // <--- Option 2 for remove warning
_.defaults(options.options, defaultOpt);
} else {
defaultOpt.auto_reconnect = false;
_.defaults(options.options, defaultOpt);
}
Hello I am working with a mongo connection but I get the following warning:
The solution is to add the new option but I'm not sure where, so it is possible in any of the following places: