'What does the second (object) parameter, { useNewUrlParser: true }, do when connecting to the database with mongoose.connect()?

I'm having trouble understanding what does the second parameter to the mongoose.connect() do.

mongoose.connect(
  "mongodb://localhost:27017/myDatabase",
  { useNewUrlParser: true }
);

Could you, please, let me know?

Thank you!

What I've tried?

I've tried searching the MongoDB docs, the Mongoose docs, the Stack Overflow, and-of course-the web. I haven't found the explanation anywhere.

Why do I care?

I'm working through the Get Programming with Node.js book and everything's going fine so far. However, I've decided to take a step back and inspect the book's provided code which contains a lot of code not introduced/shown in the book itself. I'm feeling lost due to the sheer amount of information presented in the last couple of days so I've decided to go through the book's code, line by line, and try to understand as much as I can before moving onward; otherwise, I'd feel as if I've learned when I'm well aware that I haven't. Conceptually maybe, but not in any real, practical sense.



Solution 1:[1]

With the help from Phil I've come across this. Although useNewUrlParser is depreciated, for the sake of a deeper understanding of older codebases, I found it worth it and so might you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kancharhei