0

mongodb connection error with node and express. The error:

    at QueryReqWrap.onresolve [as oncomplete] (dns.js:206:19) {
  errno: undefined,
  code: 'ECONNREFUSED',
  syscall: 'querySrv',
  hostname: '_mongodb._tcp.clustr0-a1rol.mongodb.net'
}

2 Answers2

0

Here are some possible issues with this case:

  • Check your IP address is whitelisted with your MongoDB client
  • Check your connection URI once again to check the possible error with that.

Please check this other problem and solution. link

Nayan
  • 638
  • 6
  • 15
0

I have faced the same issue, whatever I done is:

  1. restart my node server.
  2. change my database user.
  3. change my network and waiting sometime.
  4. then tried to connect.
  5. this time mongo connection was fine.

N.B- you can check your connection URI too, if its ok. then try with a different network.

Rashed
  • 1