9

I am trying to completely remove a database (delete all collections and the db itself).

When I do it from Robomongo (right click on the db -> drop database) it works as expected, but when using the driver from c# it just removes all collections of the db.

The method I am calling is: MongoDatabase.Drop(). I am using MongoDB.Driver in .Net 4.5.

1 Answer 1

12

Just for sake of completeness, the driver v2.3 has:

var client = new MongoClient(connectionString);
client.DropDatabase(dbName);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.