Phalcon\Db\Adapter\MongoDB\Collection::deleteMany PHP Method

deleteMany() public method

Deletes all documents matching the filter.
See also: DeleteMany::__construct() for supported options
See also: http://docs.mongodb.org/manual/reference/command/delete/
public deleteMany ( array | object $filter, array $options = [] ) : DeleteResult
$filter array | object Query by which to delete documents
$options array Command options
return DeleteResult
    public function deleteMany($filter, array $options = [])
    {
        if (!isset($options['writeConcern'])) {
            $options['writeConcern'] = $this->writeConcern;
        }
        $operation = new DeleteMany($this->databaseName, $this->collectionName, $filter, $options);
        $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
        return $operation->execute($server);
    }