Sokil\Mongo\Collection::batchDelete PHP Method

batchDelete() public method

Delete documents by expression
public batchDelete ( callable | array | Expression $expression = [] ) : Collection
$expression callable | array | Expression
return Collection
    public function batchDelete($expression = array())
    {
        // remove
        $result = $this->getMongoCollection()->remove(Expression::convertToArray($expression));
        // check result
        if (true !== $result && $result['ok'] != 1) {
            throw new Exception('Error removing documents from collection: ' . $result['err']);
        }
        return $this;
    }