Mongoose 3.1.0: Why the callback in the connection.db.dropDatabase(callback) is never called?
- by Totty
Code:
var connection = mongoose.createConnection('mongodb://localhost:9000/' + databaseName);
connection.db.dropDatabase(function(err){
// never reach this point!
debugger;
console.log(err);
console.log('-------------->Dropped database: ' + databaseName);
});
If I do connection.open it says that it's already opening and no multiple calls to "open" are supported for the same connection.
Even this doesn't work
var conn = mongoose.createConnection('mongodb://localhost',databaseName, 9000, {}, function(){
console.log('created'); // is reached
conn.db.dropDatabase(callback); // but the callback is not called anyway
});
What is the problem? ("mongoose": "3.1.0")
thanks