the code:
var connection = mongoose.createConnection('mongodb://localhost:9000/' + databaseName);
connection.db.dropDatabase(function(err){
debugger;
console.log(err);
console.log('-------------->Dropped database: ' + databaseName);
});
If I connect to connect.open, it says that it is already opening, and multiple access to the "open" is not supported for the same connection.
Even that doesn't work
var conn = mongoose.createConnection('mongodb://localhost',databaseName, 9000, {}, function(){
console.log('created');
conn.db.dropDatabase(callback);
});
What is the problem? ("mongoose": "3.1.0") The database is not even discarded ... thanks
source
share