lib/snapdb.js
function connect(uri, callback) {
  console.log('connecting to database (' + uri + ')');
  mongo.MongoClient.connect(uri, {safe: true}, function (err, client) {
    if (err) return callback(err);

    db = client;
    db.addListener("error", function (error) {
      console.log("mongo client error: " + error);
    });

    callback(null, db);
  });
}
function connect(uri, callback) {
  console.log('connecting to database (' + uri + ')');
  mongo.MongoClient.connect(uri, {safe: true}, function (err, client) {
    if (err) return callback(err);

    db = client;
    db.addListener("error", function (error) {
      console.log("mongo client error: " + error);
    });

    callback(null, db);
  });
}
function connect ( uri , callback ) { console . log ( 'connecting to database (' + uri + ')' ) ; mongo . MongoClient . connect ( uri , { safe : true } , function ( err , client ) { if ( err ) return callback ( err ) ; db = client ; db . addListener ( "error" , function ( error ) { console . log ( "mongo client error: " + error ) ; } ) ; callback ( null , db ) ; } ) ; }
Connect to snapdb mongo database.
Connect to snapdb mongo database .