Articles → MONGODB → Drop A Collection And The Database In Mongodb

Drop A Collection And The Database In Mongodb






Drop A Collection




Picture showing the collection in MongoDB
Click to Enlarge



db.<collection>.drop()


Picture showing executing the drop command for deleting a collection
Click to Enlarge


Drop The Database




Picture showing the list of databases
Click to Enlarge



use <database name>
db.dropDatabase()


Picture showing executing the dropdatabase command for deleting the database
Click to Enlarge




Posted By  -  Karan Gupta
 
Posted On  -  Friday, March 24, 2023

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250