When I try to connect my node.js application with mongodb atlas where I have created a database named test I get the following error in console.
Error: queryTxt ETIMEOUT cluster0.z7ysr.mongodb.netat QueryReqWrap.onresolve [as oncomplete]
I have a free tier atlas account. I have used the mongoose library and the following code in my project.
mongoose.connect('mongodb+srv://username:[email protected]/testretryWrites=true&w=majority'
{
useNewUrlParser: true,
useUnifiedTopology: true
});