Advertisement
leticiaf

startDataBase

Oct 9th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function startDataBase(callback){
  2.     MongoClient.connect('mongodb://' + dbConfig.user + ':' + dbConfig.pass + '@' + dbConfig.host + ':' + dbConfig.port + '/' + dbConfig.dataBaseName, function(err, db) {
  3.         if(err) callback(err, null);
  4.         console.log(dbConfig.host);
  5.        
  6.         var collection = db.collection("info-bus");
  7.         console.log(collection);
  8.         collection.remove({}, function(){});
  9.         callback(null, collection);
  10.     });
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement