mongodb/mongo-php-driver — pull request #794 by jmikola (2014-12-06 00:30:54+00:00)
Title: PHP-1229: Fix file/chunk deletion for GridFS::remove() and justOne

https://jira.mongodb.org/browse/PHP-1229

----

Previously, deleting a single file (with justOne) that was selected by some non-unique criteria could result in chunks from multiple files being deleted (because the initial files query was not limited).

Additionally, the final file deletion (after chunk removal) would re-use the original criteria. There is no guarantee that the same file would be matched in the second query, which could result in GridFS::remove() deleting file A's chunks but file B's file document.