C # MongoDB & # 8594; MongoDatabase.Drop () does not delete db itself

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

When I do this with Robomongo (right click on the db -> drop database), it works as expected, but when using the driver with C # it just deletes all the db collections.

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

+6
source share
1 answer

For completeness only, driver v2.3 has:

 var client = new MongoClient(connectionString); client.DropDatabase(dbName); 
+4
source

Source: https://habr.com/ru/post/981872/


All Articles