MongoHelper.js
/**
 * Reads a MongoDB Cursor into an array.
 */
Reads a MongoDB Cursor into an array.
Reads a MongoDB Cursor into an array .
function _collect(mongo, then) {
	var docs = [];
	mongo.cursor.each(function(err, doc) {
		if (err) {
			throw err;
		}
		if (doc != null) {
			docs.push(doc);
		} else {
			then({result: docs});
		}
	});
}
function _collect ( mongo , then ) { var docs = [ ] ; mongo . cursor . each ( function ( err , doc ) { if ( err ) { throw err ; } if ( doc != null ) { docs . push ( doc ) ; } else { then ( { result : docs } ) ; } } ) ; }
Reads a MongoDB Cursor into an array.
Reads a MongoDB Cursor into an array .