Can’t delete a database in MongoDB

  Kiến thức lập trình

I’m using MongoDB 7.0.

I created a database named “bob”, then decided I didn’t like that name, so I ran:

db.adminCommand({renameCollection: "bob.books", to: "bill.books"})

when I run show dbs, the database is now called bill and bob is no longer listed. However, whenever I run MongoDB Compass, it shows an empty bob database there.

I tried deleting bob through Compass and also tried db.dropDatabase(), but it keeps coming back. How do I fully delete it from returning to Compass?

LEAVE A COMMENT