0

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'
}

1 Answer 1

1

Downgrading the node version will be the solution for your issue. You can find more details from here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.