0

As I wanted to delete a collection that consists approx 50M data(monthly), the normal delete operation was throwing a timeout error even after declaring timeout to -1. the query I am using is $this->where('ts', '>', $start)->where('ts', '<' , $end)->timeout(-1)->delete(). I found bulk.find().remove() operation on mongodb doc which could help but I am unable to find find() method in any of the mongo drivers of php. any suggestions for this?

Jonas Boshen
  • 75
  • 1
  • 1
  • 9

1 Answers1

1

There is no "find and delete" operation in MongoDB. This is simply a conditional delete.

For an example using the PHP driver, try this where the $bulk->delete() call is made.

D. SM
  • 13,584
  • 3
  • 12
  • 21