0% found this document useful (0 votes)
354 views

MongoDB Cheat Sheet PDF

Collections in MongoDB are analogous to tables in a relational database, with documents representing rows. Specific collections can be deleted using the drop() method on the collection, specifying its name. Collections can also be renamed using the renameCollection() method, providing the existing and new collection names. An entire MongoDB database can be deleted by using the dropDatabase() method after selecting the database.

Uploaded by

Arjun Gautam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
354 views

MongoDB Cheat Sheet PDF

Collections in MongoDB are analogous to tables in a relational database, with documents representing rows. Specific collections can be deleted using the drop() method on the collection, specifying its name. Collections can also be renamed using the renameCollection() method, providing the existing and new collection names. An entire MongoDB database can be deleted by using the dropDatabase() method after selecting the database.

Uploaded by

Arjun Gautam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Think collections as a Table and documents as a Row

.pretty()

Delete specific collection db.<collection_name>.drop() db.books.drop()


Rename collection db.collection.renameCollection() db.rrecord.renameCollection("record")
Delete specific Database db.dropDatabase() use test //select database
db.dropDatabase()//delete current db

You might also like