Connecting to Mongo DB atlas via Monk

113 Views Asked by At

Anyone know how I can fix this

failed to connect to server [DB_CLUSTER] on first connect [MongoError: getaddrinfo ENOTFOUND

I am using Monk to connect to Mongo Atlas

var mongo = require('mongodb');
var monk = require('monk');
var db = monk(
  `Connection String is here`
);
db.then(() => {
  console.log('connection success');
}).catch((e) => {
  console.error({ e });
});
1

There are 1 best solutions below

0
On BEST ANSWER

Upgrading my version of Monk fixed this issue