Timeout mongo db

Viewed 41

Im new at mongoDB and I got this error in my terminal a few seconds after trying to start my server:

[nodemon] starting `node server.js`
Error: querySrv ETIMEOUT _mongodb._tcp.cluster0.pinlk.mongodb.net
    at QueryReqWrap.onresolve [as oncomplete] (node:dns:213:19) {
  errno: undefined,
  code: 'ETIMEOUT',
  syscall: 'querySrv',
  hostname: '_mongodb._tcp.cluster0.pinlk.mongodb.net'
}

And I have no idea where the problem could be, am I missing something in the code, or something else?

1 Answers

I had the same issue today. Was not able to solve it nicely, but what worked for me is not using the +srv connection string. I was able to connect fine using the full connection string. You can get it by selecting the 2.2.12 Node.js driver from the Connection menu. 2.2.12 Node.js driver

Related