Google News
logo
MongoDB - Interview Questions
How do we delete everything from the MongoDB database?
By using the following code, we can delete everything from the MongoDB database :
use [database];
db.dropDatabase();
Ruby code should be pretty similiar.
Also, from the command line:
mongo [Database] -eval "db.dropDatabase();"
use
[databaseName]
db.Drop+databasename();
drop colllection
use databaseName
db.collectionName.drop();
Advertisement