I wanted to delete millions of old records.date is a field we can use that

yes, by restricting the delete to a given month you can easily distribute the work over time.

another solution would be to use aggregation to $out into a temp. collection, drop the original, the move back the temp. collection into the original. that might be faster if you keep less documents than the number you want to delete. you might even reclaim more disk space.

1 Like