Section: Collection bootstrap

Drop a collection

javascript
javascript
db.users.drop()
Explanation

Use with care because the operation deletes all documents in the collection.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Collection bootstrap
Create a collection
Create a collection explicitly.
OpenIn sheetjavascriptsame section
Insert one sample document
Create a starter document.
OpenIn sheetjavascriptsame section
Read a few documents
Preview documents from a collection.
OpenIn sheetjavascriptsame section
Pretty-print query results
Format documents for easier reading.
OpenIn sheetjavascriptsame section
List databases
Show visible databases in the deployment.
OpenIn sheetjavascript1 tag match
Switch database
Change the current database context.
OpenIn sheetjavascript1 tag match