mongodbmongodb-atlasmonk

Connecting to Mongo DB atlas via Monk


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 });
});

Solution

  • Upgrading my version of Monk fixed this issue