title: Warning on Connecting to MongoDB with a Node server
body: <h2>Connecting with MongoDB native driver</h2>
  
  <p>I wrote following code to connect mongodb through native driver which has been install with <code>npm install mongodb --save</code></p>
  
  <pre><code>const MongoClient = require("mongodb").MongoClient;
  const url = "mongodb://127.0.0.1:27017";
  
  const dbName = "game-of-thrones";
  let db;
  
  MongoClient.connect(
  url,
   { useNewUrlParser: true },
    (err, client) =&gt; {
      if (err) return console.log(err);
  
    db = client.db(dbName);
     console.log(`Connected MongoDB: ${url}`);
     console.log(`Database: ${dbName}`);
    }
  );
  </code></pre>
  
  <p>When I write on the terminal <code>node server.js</code> I got following error </p>
  
  <blockquote>
    <p>(node:3500) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to MongoClient.connect.
    Connected MongoDB: mongodb://127.0.0.1:27017
    Database: game-of-thrones</p>
  </blockquote>
  
  <p>The database is connected, but how can I get rid out from the warning</p>