I have installed everything properly but don't know what had happened. This is the code
// Connect to MongoDB
const dbURI = 'mongodb+srv://<username>:<password>@blogging-site.mantx.mongodb.net/Blogging-site?retryWrites=true&w=majority';
try {
// Connect to the MongoDB cluster
mongoose.connect(dbURI,{ useNewUrlParser: true, useUnifiedTopology: true },
() => console.log(" Mongoose is connected")
);
} catch (e) {
console.log("could not connect");
}
The error in my VS code treminal is - Error: queryTxt ETIMEOUT blogging-site.mantx.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19) {
errno: undefined,
code: 'ETIMEOUT',
syscall: 'queryTxt',
hostname: 'blogging-site.mantx.mongodb.net'
}
I am following net Ninja tutorials and hope i haven't left any step as he instructed.
I had earlier used mongoDB atlas and have mongodb installed in my computer. Does that create any problem ?