DEV Community

Cover image for Warning: Current Server Discovery and Monitoring engine
Robiul
Robiul

Posted on

2 2

Warning: Current Server Discovery and Monitoring engine

[MONGODB DRIVER] 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.

Using the Winston to write the MongoDB logger. we have to pass everything which is required for MongoDB.
If we mistake anything it will make an error

If you use your project Winston logger and you did not pass options into the Winston transport that's why you get the error.

Following this.
The error will be gone.

winston.add(new winston.transports.MongoDB({
    db: 'mongodb://localhost:27017/',
    options: {
        useUnifiedTopology: true,
    }
}));
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more