Query.php
public function delete($db = null, $options = [])
    {
        if ($this->emulateExecution) {
            return [];
        }
        return $this->createCommand($db)->deleteByQuery($options);
    }
public function delete($db = null, $options = [])
    {
        if ($this->emulateExecution) {
            return [];
        }
        return $this->createCommand($db)->deleteByQuery($options);
    }
public function delete ( $ db = null , $ options = [ ] ) { if ( $ this -> emulateExecution ) { return [ ] ; } return $ this -> createCommand ( $ db ) -> deleteByQuery ( $ options ) ; }
Executes the query and deletes all matching documents.

Everything except query and filter will be ignored.

@param Connection $db the database connection used to execute the query.
If this parameter is not given, the `elasticsearch` application component will be used.
@param array $options The options given with this query.
@return array the query results.
Executes the query and deletes all matching documents .