public function remove(array $criteria = [], array $options = [])
    {
        $multiple = isset($options['justOne']) ? !$options['justOne'] : true;
        $method = $multiple ? 'deleteMany' : 'deleteOne';

        try {
            /** @var \MongoDB\DeleteResult $result */
            $result = $this->collection->$method(
                TypeConverter::fromLegacy($criteria),
                $this->convertWriteConcernOptions($options)
            );
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            throw ExceptionConverter::toLegacy($e);
        }

        if (! $result->isAcknowledged()) {
            return true;
        }

        return [
            'ok' => 1.0,
            'n' => $result->getDeletedCount(),
            'err' => null,
            'errmsg' => null
        ];
    }
public function remove(array $criteria = [], array $options = [])
    {
        $multiple = isset($options['justOne']) ? !$options['justOne'] : true;
        $method = $multiple ? 'deleteMany' : 'deleteOne';

        try {
            /** @var \MongoDB\DeleteResult $result */
            $result = $this->collection->$method(
                TypeConverter::fromLegacy($criteria),
                $this->convertWriteConcernOptions($options)
            );
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            throw ExceptionConverter::toLegacy($e);
        }

        if (! $result->isAcknowledged()) {
            return true;
        }

        return [
            'ok' => 1.0,
            'n' => $result->getDeletedCount(),
            'err' => null,
            'errmsg' => null
        ];
    }
public function remove ( array $ criteria = [ ] , array $ options = [ ] ) { $ multiple = isset ( $ options [ 'justOne' ] ) ? ! $ options [ 'justOne' ] : true ; $ method = $ multiple ? 'deleteMany' : 'deleteOne' ; try { /** @var \MongoDB\DeleteResult $result */ $ result = $ this -> collection -> $ method ( TypeConverter :: fromLegacy ( $ criteria ) , $ this -> convertWriteConcernOptions ( $ options ) ) ; } catch ( \ MongoDB \ Driver \ Exception \ Exception $ e ) { throw ExceptionConverter :: toLegacy ( $ e ) ; } if ( ! $ result -> isAcknowledged ( ) ) { return true ; } return [ 'ok' => 1.0 , 'n' => $ result -> getDeletedCount ( ) , 'err' => null , 'errmsg' => null ] ; }
Remove records from this collection

@link http://www.php.net/manual/en/mongocollection.remove.php
@param array $criteria Query criteria for the documents to delete.
@param array $options An array of options for the remove operation.
@throws MongoCursorException
@throws MongoCursorTimeoutException
@return bool|array Returns an array containing the status of the removal
if the "w" option is set. Otherwise, returns TRUE.
Remove records from this collection