When starting up my application, I get the following warning:
(node:11800) 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.
Yet we are specifying this value:
connection = await mongoose.connect(dbUrl, {
keepAlive: true,
useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false,
useUnifiedTopology: true
});
The value for dbUrl
is: mongodb://localhost:27017/test-app
Environment:
mongo v4.0.13 on macOS
nodejs v10.15.3
package mongodb@3.3.2
package mongoose@5.7.0
Any ideas on how to deal with the warning?