public function deleteFileById($id)
    {
        if ($id instanceof \MongoId) {
            $result = $this->getMongoCollection()->delete($id);
        } else {
            try {
                $result = $this->getMongoCollection()->delete(new \MongoId($id));
            } catch (\MongoException $e) {
                $result = $this->getMongoCollection()->delete($id);
            }
        }
        if ($result['ok'] !== (double) 1) {
            throw new Exception('Error deleting file: ' . $result['err'] . ': ' . $result['errmsg']);
        }
        
        return $this;
    }
public function deleteFileById($id)
    {
        if ($id instanceof \MongoId) {
            $result = $this->getMongoCollection()->delete($id);
        } else {
            try {
                $result = $this->getMongoCollection()->delete(new \MongoId($id));
            } catch (\MongoException $e) {
                $result = $this->getMongoCollection()->delete($id);
            }
        }
        if ($result['ok'] !== (double) 1) {
            throw new Exception('Error deleting file: ' . $result['err'] . ': ' . $result['errmsg']);
        }
        
        return $this;
    }
public function deleteFileById ( $ id ) { if ( $ id instanceof \ MongoId ) { $ result = $ this -> getMongoCollection ( ) -> delete ( $ id ) ; } else { try { $ result = $ this -> getMongoCollection ( ) -> delete ( new \ MongoId ( $ id ) ) ; } catch ( \ MongoException $ e ) { $ result = $ this -> getMongoCollection ( ) -> delete ( $ id ) ; } } if ( $ result [ 'ok' ] !== ( double ) 1 ) { throw new Exception ( 'Error deleting file: ' . $ result [ 'err' ] . ': ' . $ result [ 'errmsg' ] ) ; } return $ this ; }
Delete file by id

@param string|\MongoId $id id of file's document
@return \Sokil\Mongo\GridFS
@throws Exception
Delete file by id