Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Commit

Permalink
db; refresh collections after dropping
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Jan 26, 2013
1 parent 688c8df commit e7e6b88
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/db.js
Expand Up @@ -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);
});
});
}

Expand Down

0 comments on commit e7e6b88

Please sign in to comment.