MongoDB\Driver\BulkWrite::delete
(mongodb >=1.0.0)
MongoDB\Driver\BulkWrite::delete — Add a delete operation to the bulk
Описание
public void MongoDB\Driver\BulkWrite::delete
( array|object
$filter
[, array $deleteOptions
] )Adds a delete operation to the MongoDB\Driver\BulkWrite.
Список параметров
-
filter
(array|object) -
The search filter.
-
deleteOptions
-
deleteOptions Option Type Description Default limit bool Delete all matching documents (limit=0), or only the first matching document (limit=1) FALSE
Возвращаемые значения
Эта функция не возвращает значения после выполнения.
Ошибки
- Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.
Примеры
Пример #1 MongoDB\Driver\BulkWrite::delete() example
<?php
$bulk = new MongoDB\Driver\BulkWrite;
$bulk->delete(['x' => 1], ['limit' => 1]);
$bulk->delete(['x' => 2], ['limit' => 0]);
$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017');
$writeConcern = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 1000);
$result = $manager->executeBulkWrite('db.collection', $bulk, $writeConcern);
?>
Смотрите также
- MongoDB\Driver\Manager::executeBulkWrite() - Execute one or more write operations
- MongoDB\Driver\WriteResult
Коментарии
404 Not Found