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

386
Views
Mongoose no pudo conectarse y Atlas MongoDB espera incluir IP en la lista blanca mientras que todas las IP están permitidas

Espero que alguien pueda ayudarme porque me confundí con este problema. Pensé que mi código estaba bien, pero Atlas parece rechazarlo, por lo que no pude conectarme a Atlas. La conexión tan simple. Lleno esos parámetros de nodemon.json:

 const { MONGODB_ATLAS_USERNAME, MONGODB_ATLAS_PASSWORD, MONGODB_ATLAS_DBNAME } = process.env var mongoose = require('mongoose'); app.listen(PORT, () => { console.info(`App is running! at http://localhost:${PORT}`) }) mongoose.connect(`mongodb://${MONGODB_ATLAS_USERNAME}:${MONGODB_ATLAS_PASSWORD}@cluster0.lzjty.mongodb.net/${MONGODB_ATLAS_DBNAME}?retryWrites=true&w=majority&ssl=true`,{useNewUrlParser:true,useUnifiedTopology:true});

En Atlas, incluí mi IP en la lista blanca y permití que todas las IP se conecten ingrese la descripción de la imagen aquí Pero cada ejecución de npm, el retorno siempre:

 App is running! at http://localhost:8080 [1] (node:2012) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Generalmente sucede cuando usas una IP pública. Cambia cada vez que se conecta a Internet y necesita realizar cambios en MONGO Atlas. Le sugiero que haga estos cambios para el desarrollo.

Siga esto: - MongoDB Atlas -> NetworkAccess -> Edit -> Allow Any

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!