Permalink
Browse files

db; refresh collections after dropping

  • Loading branch information...
1 parent 688c8df commit e7e6b8834ba07bd12384979c5df115025c088f71 @aheckmann committed Jan 26, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/db.js
View
@@ -44,11 +44,16 @@ function createConstructor (db) {
DB.prototype.drop = function (cb) {
var name = db.databaseName;
- db.dropDatabase(cb || function (err, worked) {
+ db.dropDatabase(cb || function (err) {
if (err) {
return console.error(err);
}
- log('database %s was dropped', name);
+
+ process.emit('gomon:db-dropped', name);
+
+ db.collections(function () {
+ log('database "%s" was dropped', name);
+ });
});
}

0 comments on commit e7e6b88

Please sign in to comment.