My mongodb info etc. I entered it correctly, but every time I try to run the code, I keep getting this error. Attached is some of my code and a picture of the error.
Source Code
const vars = require("../variables");
const url = vars.dbLink; // vars.dbLink
const dbName = "channels";
var database;
const client = new MongoClient(url, { useNewUrlParser: true, useUnifiedTopology: true });
function connect(callback) {
MongoClient.connect(url, { useNewUrlParser: true }, (err, res) => {
const db = res.db(dbName);
database = db;
return callback(err);
});
}