title: getting TypeError: Cannot read property 'db' of undefined
body: <p>When I run the project on which I have a mongo compass and all settings are given, everything is normal, but when I try to run on another computer(mac) I getting this error, is it possible?</p>
  <pre class="lang-js prettyprint-override"><code>async function start() {
    app.listen(PORT, () =&gt; {
      console.log(`Server is running on port ${PORT}`);
    });
  
    try {
      await MongoClient.connect(
        'mongodb://127.0.0.1:27017',
        { useUnifiedTopology: true, useNewUrlParser: true },
        function (err, db) {
          var dbase = db.db('Server');
          if (err) {
            console.log(err);
          } else {
            console.log('connected!');
            /*  dbase.createCollection('posts') */
          }
        }
      );
    } catch (e) {
      console.log('Server error', e.message);
      process.exit(1);
    }
  
    ngrok.connect(
      {
        proto: 'http',
        addr: process.env.PORT,
      },
      (err, url) =&gt; {
        if (err) {
          console.error('Error while connecting Ngrok', err);
          return new Error('Ngrok Failed');
        }
      }
    );
  }
  start();
  </code></pre>