How to delete 1 million documents while using field name which contain " DRIAN"

need help on how to delete 100 million documents where collection name: “Text”, field name: “user” and contain “DRIAN.”


Using mongosh, writing a query using deleteMany will do the job.

e.g. database.collection.deleteMany(filter);

// deleteMany - Removes all documents that match the filter from a collection.


Thank you !
What about bulk deletion ?

The deleteMany function as mentioned by wedothebest_We_do_the_Best is perfectly fine for your use-case.

Why would you want to complicate things with bulk deletion?

Is there something in your use-case that you did not share with us that would make bulk deletion better suited?

Bulk operations are suitable when you cannot specify all the targeted documents with a single filter and operation.