I have an app that has been maxing out the number of connection to MongoDB and I was under the assumption that if the drivers were set up correctly you didn't need to worry about closing connections.

I've seen people mention the Generic Pool module but what is the best process for closing or pooling connections using Node & MongoDB?

Here is my connection code for the app:

```
var sys = require("sys");
var app = require('http').createServer(handler);
var io = require('socket.io').listen(app);

app.listen(1337);

io.configure(function () {
io.set('authorization', function (handshakeData, callback) {
    callback(null, true);
    });
});

function handler (req, res, data) {
    sys.puts('request made to trackerapp.js'); 
    res.writeHead(200);
    res.end(data);
}

io.sockets.on('connection', function (socket) {
  socket.on('adTracker', function (data) {
  var adRequestData = data;
  var databaseUrl = "mongodb://dbuser:dbpass@mongolab.com/tracker";
  var collections = ["cmnads"]
  var db = require("mongojs").connect(databaseUrl, collections);

    db.cmnads.insert({adRequest : adRequestData},function(err, updated) {
        if( err || !updated ) console.log("mongo not updated" + err);
        else console.log("data stored");
      });
    });
});

```