public function delete($collectionName, $condition, $options = [])
    {
        $batchOptions = [];
        foreach (['bypassDocumentValidation'] as $name) {
            if (isset($options[$name])) {
                $batchOptions[$name] = $options[$name];
                unset($options[$name]);
            }
        }

        $this->document = [];
        $this->addDelete($condition, $options);
        $result = $this->executeBatch($collectionName, $batchOptions);

        return $result['result'];
    }
public function delete($collectionName, $condition, $options = [])
    {
        $batchOptions = [];
        foreach (['bypassDocumentValidation'] as $name) {
            if (isset($options[$name])) {
                $batchOptions[$name] = $options[$name];
                unset($options[$name]);
            }
        }

        $this->document = [];
        $this->addDelete($condition, $options);
        $result = $this->executeBatch($collectionName, $batchOptions);

        return $result['result'];
    }
public function delete ( $ collectionName , $ condition , $ options = [ ] ) { $ batchOptions = [ ] ; foreach ( [ 'bypassDocumentValidation' ] as $ name ) { if ( isset ( $ options [ $ name ] ) ) { $ batchOptions [ $ name ] = $ options [ $ name ] ; unset ( $ options [ $ name ] ) ; } } $ this -> document = [ ] ; $ this -> addDelete ( $ condition , $ options ) ; $ result = $ this -> executeBatch ( $ collectionName , $ batchOptions ) ; return $ result [ 'result' ] ; }
Removes documents from the collection.
@param string $collectionName collection name.
@param array $condition filter condition.
@param array $options delete options.
@return WriteResult write result.
Removes documents from the collection .