title: cannot connect to the mongo database
body: <p>I cann't connect to the database mongo db. The type error is present. How can I do?
  server.js:</p>
  
  <pre><code>let MongoClient = require("mongodb").MongoClient;
  let express = require("express");
  let bodyParser = require("body-parser");
  let app = express();
  let db;
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: true }));
  app.get("/", function(req, res) {
    res.send("Hello API");
  });
  
  app.listen(3114, function() {
    console.log("API app started");
  });
  MongoClient.connect("mongodb://localhost:27017/test_db", {
    useUnifiedTopology: true,
    useNewUrlParser: true
  });
  </code></pre>
  
  <p>Console log:</p>
  
  <pre><code>API app started
  TypeError: Cannot read property 'collection' of undefined
  at /home/bukrole/db.project/server.js:18:6
  </code></pre>