title: connect is not a function when connecting to mongodb
body: <p>Error occurs when trying to run the function from the <code>mongodb</code> website that connects code to db.</p>
  
  <pre><code>const MongoClient = require('mongodb')
  
  const client = new MongoClient(uri, { useNewUrlParser: true });
  client.connect(err =&gt; {
    const collection = client.db("test").collection("devices");
    // perform actions on the collection object
    client.close();
  });
  </code></pre>
  
  <p>Error is:</p>
  
  <pre><code>client.connect(err =&gt; {
    ^
  
      TypeError: client.connect is not a function
  </code></pre>
  
  <p>I have <code>mongodb</code> installed via <code>npm</code> and uri defined as the string they gave. Do I need anything else? </p>