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

116
Visualizações
Mongoose connection issue with .env used into access

I am unable to pass requests with postman, and the error message is the one being printed on console. Before applying then method I was able to see the connection successful mssage but still wasn't able to get/post via postman

//database connection
mongoose.connect(
  process.env.MONGO_URL,
  { useNewUrlParser: true, useUnifiedTopology: true }).then(()=>{
    console.log("connection successful")
  }).catch((error)=>{
    console.log("Error occured on connection")
  });

Requiring the connection via

const mongoose = require("mongoose");

and the MONGO_URL mentioned in .env file is

MONGO_URL = mongodb+srv://username:password@cluster0.8noo9.mongodb.net/dbname?retryWrites=true&w=majority

been stuck here for a while. I am setting up mongoose for the first time

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It was due to not whitelisting m IP. If anyone has the same issue try it first. Go to mongodb and whitelist your IP in security -> network connections

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