Hi,
I am having the same issue. My mongoose.connect isn’t working. I am quite new to MongoDB so I am afraid I don’t know how to change my DNS.
I am using port 5000.
app.listen(port, (req, res) => {
console.log(port);
})
mongoose.connect('mongodb+srv://<username>:<password>@cluster0.g1tk0kd.mongodb.net/?retryWrites=true&w=majority', {
useNewUrlParser: true,
useUnifiedTopology: true
}).then(()=>{
console.log('You are connected to mongoDB');
}).catch((error)=>{
console.log("mongoDb failed: ", error.message);
})
I’d appreciate any help, I have tried a different port. I also added another IP / another user. and the issue persists.
Kind regards,