const MongoClient = require('mongodb').MongoClient; const assert = require('assert'); // Connection URL const url = 'mongodb://localhost:27017'; // Database name const dbName = 'myproject'; (async function() { try { const client = await MongoClient.connect(url); console.log("Connected correctly to server"); const db = client.db(dbName);