node package manager


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 (err, collection) {
    //do stuff 
var db = require('mongo-start')(); //mongojs db object 
db.getCollectionNames(function(err, collectionNames) {
    //collections in the db