OPTIONS

drop

drop

The drop command removes an entire collection from a database. The command has following syntax:

{ drop: <collection_name> }

The mongo shell provides the equivalent helper method db.collection.drop().

This command also removes any indexes associated with the dropped collection.

Warning

This command obtains a write lock on the affected database and will block other operations until it has completed.

←   listCollections create  →

Was this page helpful?

Yes No

Thank you for your feedback!

We're sorry! You can Report a Problem to help us improve this page.