Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda