Help!! the result of db.dropDatabase is "true" but the database and it's contents still exist when I check from the terminal.

19 views
Skip to first unread message

Emmanuel Olaojo

unread,
Sep 7, 2017, 9:05:30 AM9/7/17
to mongodb-user

after(function(done){
  mongo
.connect(db, function (err, db) {
   
if(err) return done(err);

    db.dropDatabase(function (err, res){
     
if(err) return done(err);

      console
.log("result:", res); // output = "result: true" but the database is really still there.
      db
.close(done);

    });

  });
});

Kevin Adistambha

unread,
Sep 19, 2017, 3:14:29 AM9/19/17
to mongodb-user

Hi,

Could you provide more details:

  • What is your MongoDB version, your driver version, and the storage engine you use (MMAPv1 or WiredTiger)
  • What is your deployment topology (standalone, replica set, or sharded cluster)
  • Can you still query/connect to the dropped database?
  • Is this still an issue when using the mongo shell?
  • Do you drop your database often?
  • Is this an intermittent issue, or does this happen all the time?

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages