A very opinionated way to connect with the mongodb driver.
An opinionated way to connect with the mongodb driver.
npm install mongo-getdb
var getDb = ;getDb;;
getDb.init allows the same parameters than MongoClient.connect.
Because I keep doing the same thing over and over everytime I want to use mongodb from node and because this is what works for us most of the time.
This will "memoize" the result of MongoClient.connect, so you can use getDb anywhere.
var getDb = ;getDb;getDb;;
MIT - 2013 - José F. Romaniello