Reputation: 737
I was saving and retrieving data in MongoDB using NodeJS. It was working properly. Now suddenly, it has started to display the following error message in the console. If I restart the NodeJS server then, again sometimes it works. How to fix this. Is this error related to MongoDB or mongoose itself?
I am using mongoose "mongoose": "^5.12.11",
and MongoDB driver version NodeJS 3.6 or later
in MongoDB Atlas.
Error: querySrv ECONNREFUSED _mongodb._tcp.socail.xngew.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19) {
errno: undefined,
code: 'ECONNREFUSED',
syscall: 'querySrv',
hostname: '_mongodb._tcp.socail.xngew.mongodb.net'
}
Upvotes: 0
Views: 63
Reputation: 51
Downgrading the node version will be the solution for your issue. You can find more details from here
Upvotes: 1