2

My problem:

const conn = await mongoose.connect(process.env.MONGO_URI, {
            useNewUrlParser: true,
            useUnifiedTopology: true,
            useFindAndModify: false
        })

Error shown:
Server running in development mode on port 3000
Error: querySrv ETIMEOUT _mongodb._tcp.traversycluster.nzw0imj.mongodb.net
    at QueryReqWrap.onresolve [as oncomplete] (node:dns:213:19) {
  errno: undefined,
  code: 'ETIMEOUT',
  syscall: 'querySrv',
  hostname: '_mongodb._tcp.traversycluster.nzw0imj.mongodb.net'
}

I tried commenting but I see it is no longer necessary. But the server gets a timeout pretty quickly (within a few seconds). How do I prolong the time of the querySrv TIMEOUT?

Charchit Kapoor
  • 8,934
  • 2
  • 8
  • 24
Dion Esq.
  • 21
  • 4
  • Do you have driver versions and other configuration information available? There seem to be a number of hits for this error message on this site such as [this question](https://stackoverflow.com/questions/55499175/how-to-fix-error-querysrv-erefused-when-connecting-to-mongodb-atlas) – user20042973 Oct 05 '22 at 16:53

0 Answers0