Skip to content

troubleshooting of "DeprecationWarning Error" #3

@livetoworldlife

Description

@livetoworldlife

if you get this error below when you run your app.js after part of the "Setting Up our Application",

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.
(Use `node --trace-deprecation ...` to show where the warning was created)

change the mongoOptions object in db.js file such as that below

const mongoOptions = {
  useNewUrlParser: true,
  useUnifiedTopology: true //  add this part to get ride of the error
};

I hope that is gonna help you.
Because it worked on my code...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions