MongoDB\Driver\BulkWriteCommand::deleteMany

Add a deleteMany operation

&reftitle.description; public `void` `MongoDB\Driver\BulkWriteCommand::deleteMany` `string` `namespace` ``array``object```filter` ``array``null```options`&null;

Add a deleteMany operation to the `MongoDB\Driver\BulkWriteCommand`. All documents matching `filter` in the collection identified by `namespace` will be deleted.

&reftitle.parameters;
&mongodb.parameter.namespace; &mongodb.parameter.filter;

`options`

- ## options

  Option | Type | Description | Default
  &mongodb.option.collation;
  hint | ``string``array``object`` | Index specification. Specify either the index name as a string or the index key pattern. If specified, then the query system will only consider plans using the hinted index.

&reftitle.returnvalues;

&return.void;

&reftitle.errors;

&mongodb.throws.argumentparsing;

&reftitle.examples;

### `MongoDB\Driver\BulkWriteCommand::deleteMany` example

    <?php

    $manager = new MongoDB\Driver\Manager;

    $bulk = new MongoDB\Driver\BulkWriteCommand;
    $bulk->deleteMany('db.coll', ['x' => ['$gt' => 1]]);

    $result = $manager->executeBulkWriteCommand($bulk);

    ?>

&reftitle.seealso;

- `MongoDB\Driver\BulkWriteCommand::deleteOne`
- `MongoDB\Driver\Manager::executeBulkWriteCommand`
- `MongoDB\Driver\BulkWriteCommandResult`