> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Delete Multiple Documents

MongoDB Compass Readonly Edition will be deprecated in a future release. To replicate the read-only behavior in a standard Compass edition, assign users [`read`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-read) access at the database level and enable the [readOnly](https://www.mongodb.com/docs/compass/settings/read-only.md#std-label-compass-read-only) option in Compass.

You can perform bulk delete operations on multiple documents in Compass by using the Delete Documents modal. This helps you visualize deletes before applying them.

## About this Task

Deleting documents is a permanent action and cannot not be undone. Validate documents in the Preview of the Delete Documents modal before confirming the delete operation.

## Steps

1. Apply a query filter.

   From the Documents tab, input a query into the Query Bar to filter deleted documents. To delete all documents in the collection, leave the Query Bar blank.

2. Open the bulk delete modal.

   On the Documents tab, either right-click the query bar or its surrounding whitespace and select Bulk delete from the dropdown, or click the  Bulk drop-down menu and select Bulk delete documents, to display the Delete Documents modal. The modal contains the following information:

   | UI Element | Description |
   | --- | --- |
   | Query | Any filter criteria specified on the Query Bar applies to the Delete Documents modal. To update the Query, exit the Delete Documents modal and modify the query in the Query Bar. |
   | Export | Opens the Export Delete Query To Language modal, where you can convert the query to a supported driver language. |
   | Preview | A preview of the documents that will be deleted. |

3. (Optional) Export the delete query.

   You can export the Delete query to a supported driver language using the Export button on the Delete Documents modal.

   On the Delete Documents modal, click Export. The Export Delete Query To Language modal displays with the delete syntax populated under My Delete Query.

   Select a programming language from the drop-down under Exported Delete Query. You can convert the command to C#, Go, Java, Node, PHP, Python, Ruby, or Rust. The field below displays the converted syntax.

   (Optional) Click the Include Import Statements checkbox to include the required import statements for the selected programming language.

   Click the  icon to copy the converted syntax.

   Click Close.

4. Delete your documents.

   On the Delete Documents modal, click Delete Documents and confirm the operation on the next modal.

   Compass deletes the documents that match the filter expression.

## Example

The following example deletes two documents from the `movies` collection in the [sample\_mflix dataset.](https://www.mongodb.com/docs/atlas/import/load-sample-data.md#std-label-sample-data)

In the Query Bar, enter a filter for movies with a `year` of `1919`.

```javascript
{ 'year' : 1919 }
```

Click the  Bulk drop-down menu and select Bulk delete documents. The Delete Documents modal displays.

The Preview pane shows the documents included in the delete operation.

Click Delete Documents. A confirmation modal displays.

Click the red Delete Documents button to confirm the operation.

## Learn More

- [Modify Multiple Documents](https://www.mongodb.com/docs/compass/documents/modify-multiple.md#std-label-compass-bulk-update)
