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