title: How to close all connections to the MongoDB server
body: <p>I am using <a href="https://github.com/christkv/node-mongodb-native" rel="nofollow">Node MongoDB native driver</a> to connect to MongoDB database:</p>
  
  <pre><code>// Open a connection
  db.open(function (err, db) {
    db.close();
  });
  
  // Open another connection
  db.open(function (err, db) {
    db.close();
  });
  </code></pre>
  
  <p>I saw two connection accepted in <code>mongodb.log</code> file, but only one end connection. And the program did not exit, I think it's still waiting for the second connection to be closed. How do you close all connections?</p>