Does Mongo Compass include Delete many documents at one time function?

Viewed 23849

I'm using MongoDB for a while with my projects. But Um currently New to MongoDB compass application. so When I want to delete a lot of documents at a time . How will I perform that operation in Mongo Compass ?

5 Answers

A workaround in Compass, drop the collection first and then create the collection with the same name, or even import some sample document.

The only way [until release 1.20.5], is to execute the delete command from mongo-shell.
Here are the steps and example to delete multiple documents matching a filter, using a mongo-shell

  1. download mongo-shell from the link
  2. Open the command-prompt and navigate to the folder where binary files are present
  3. Connect to mongo-server, Run the connection command > mongo "mongodb+srv://cluster-name.mongodb.net/db_name" --username <uasername> --password <password>
  4. example delete command, run : db.users.remove( { status : "P" } ) to remove all documents from the users collection where the status field equals "P"
Related