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?