title: How to close a connection to MongoDB
body: <p>I have a class that create the a MongoClient inside:</p>
  
  <pre><code>db = MongoDB ('mydb' , 'config')
  </code></pre>
  
  <p>I am successfully able to connect to 'mydb' database and 'config' collection - but after querying the collection I do need this connection to database again. I proceed to create connection with another database and collection</p>
  
  <pre><code>db = MongoDB ('mapping' , 'box_details')
  </code></pre>
  
  <p>In such a case how can I close the connection to DB previously - is it that it would automatically get closed when app exits?</p>