How do I manage MongoDB connections in a Node.js web application?
The primary committer to node-mongodb-native says: You open do MongoClient.connect once when your app boots up and reuse the db object. It’s not a singleton connection pool each .connect creates a new connection pool. So, to answer your question directly, reuse the db object that results from MongoClient.connect(). This gives you pooling, and will provide … Read more