MongoDB Delete Document
Use db.colloction.remove() method to delete any document from MongoDB collection on basis of critaria.
Delete Matching Document
Now use the following command deletes a specific document from MongoDB collection with user_name = rahul.
The above command will remove all document having user_name rahul. To remove only first matching document from collection use following command.
Delete All Documents in Collection
Use the following command with no deletion criteria to delete all documents from the specific collection. For example, below will delete all documents from users collection.