Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

148
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda