• +91 9723535972
  • info@interviewmaterial.com

MongoDB Interview Questions and Answers

Question - How do we delete everything from the MongoDB database?

Answer -

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();

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners