Skip to content

Instantly share code, notes, and snippets.

@ahmad-ali14
Created June 13, 2020 22:37
Show Gist options
  • Save ahmad-ali14/9ffd17b5904aa64481521f3d0ff194ae to your computer and use it in GitHub Desktop.
Save ahmad-ali14/9ffd17b5904aa64481521f3d0ff194ae to your computer and use it in GitHub Desktop.
//DB and authentication
mongo.connect(process.env.DATABASE, (err, cluster) => {
if(err) {
console.log('Database error: ' + err);
} else {
//connecting to the cluster
console.log('Successful database connection');
//connetcing to the database
const db = cluster.db(DATABASE_NAME);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment