public function remove(array $criteria = [], array $options = [])
    {
        $this->createChunksIndex();

        $matchingFiles = parent::find($criteria, ['_id' => 1]);
        $ids = [];
        foreach ($matchingFiles as $file) {
            $ids[] = $file['_id'];
        }
        $this->chunks->remove(['files_id' => ['$in' => $ids]], ['justOne' => false] + $options);
        return parent::remove(['_id' => ['$in' => $ids]], ['justOne' => false] + $options);
    }
public function remove(array $criteria = [], array $options = [])
    {
        $this->createChunksIndex();

        $matchingFiles = parent::find($criteria, ['_id' => 1]);
        $ids = [];
        foreach ($matchingFiles as $file) {
            $ids[] = $file['_id'];
        }
        $this->chunks->remove(['files_id' => ['$in' => $ids]], ['justOne' => false] + $options);
        return parent::remove(['_id' => ['$in' => $ids]], ['justOne' => false] + $options);
    }
public function remove ( array $ criteria = [ ] , array $ options = [ ] ) { $ this -> createChunksIndex ( ) ; $ matchingFiles = parent :: find ( $ criteria , [ '_id' => 1 ] ) ; $ ids = [ ] ; foreach ( $ matchingFiles as $ file ) { $ ids [ ] = $ file [ '_id' ] ; } $ this -> chunks -> remove ( [ 'files_id' => [ '$in' => $ ids ] ] , [ 'justOne' => false ] + $ options ) ; return parent :: remove ( [ '_id' => [ '$in' => $ ids ] ] , [ 'justOne' => false ] + $ options ) ; }
Removes files from the collections

@link http://www.php.net/manual/en/mongogridfs.remove.php
@param array $criteria Description of records to remove.
@param array $options Options for remove.
@throws MongoCursorException
@return boolean
Removes files from the collections