MongoDB Drop Collection (original) (raw)

Last Updated : 5 May, 2026

Dropping a collection in MongoDB permanently removes the collection along with all its documents and indexes, helping maintain a clean and organized database.

Collection Drop Operation in MongoDB

The drop() method deletes a collection by locking it exclusively and notifying active change streams.

**Syntax:

db.collection_name.drop({writeConcern: })

Behaviour of MongoDB Drop()

Examples of MongoDB Drop Collection

We have collections called student and teacher in gfg database and we will perform all the operation on that collection for better understanding.

**Example 1: We will drop the student collection in the gfg database.

db.student.drop()

**Output:

true

It drops the student collection and all the indexes associated with the collection.

**Example 2: We want to drop the teacher collection from the gfg database.

db.teacher.drop()

**Output:

true

This method drops the teacher collection along with its documents.