0

I'm trying to deploy a blog app with a mongoDB Atlas Cluster (I have a mongodb for my local as well), but I can't seem to connect. I keep getting this error in my terminal:

Error: querySrv ENODATA _mongodb._tcp.cluster0-1qme8.mongodb.net

I've read the other posts on this but still can't figure it out. Maybe I'm not configuring the string correctly?

mongoose.connect("mongodb+srv://<myName>:<myPassword>@cluster0-1qme8.mongodb.net/test?retryWrites=true&w=majority", {
  useNewUrlParser:true,
  useCreateIndex:true,
}).then(() => {
  console.log("Connected to DB!");

}).catch(err => {
  console.log("Error:", err.message);

});

I've whitelisted all ip's so it's accessible anywhere. I even tried my own ip to test it out and it still wont' work. Does anyone know what my problem is?

RRhodes
  • 501
  • 6
  • 19
  • Can you try the options suggested in this thread: https://stackoverflow.com/questions/54484673/error-querysrv-enodata-mongodb-tcp-blog-cluster-0hb5z-mongodb-net-at-queryreq – Tunmee Feb 12 '20 at 09:32
  • Yep, I've tried that. I have my ip whitelisted at 0.0.0.0/0, so it should work from anywhere. I've also tried 8.8.8.8/8 and my own ip as well. – RRhodes Feb 12 '20 at 13:07

0 Answers0