Oddly, both the delete_one() and delete_many() methods have a lot in common with find(): they both accept a filter dictionary, which is identical to a query document. Here is the syntax summary for these commands:
delete_one(filter, collation=None, session=None)
delete_many(filter, collation=None, session=None)
The main difference between these two commands is how many documents they are capable of deleting: one or many. Here is a brief summary of the command syntax:
Parameter | Default | Notes |
filter | None | A dictionary consisting of key/value pairs, where the key represents the field to search and the value represents the search criteria. If set to None, all the documents in the collection are selected. |
collation | None | You can supply a pymongo.collation.Collation instance, which allows you to influence how search and sort operate. This is especially useful if you are collecting information on a website that... |