Simple wrapper to get a mongojs collection


A simple mongojs wrapper to return a collection so you don't need to write the same thing over and over.

To configure the connection you can create an environment variable called "mongo-connection". However since mongo-start uses qconf you can store the setting anywhere that qconf lets you.

var users = require('mongo-start')('users'); //mongojs collection 
users.find({...}, function (errcollection) {
    //do stuff 
var db = require('mongo-start')(); //mongojs db object 
db.getCollectionNames(function(errcollectionNames) {
    //collections in the db