Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!