PHP Класс Phalcon\Db\Adapter\MongoDB\Operation\BulkWrite

См. также: MongoDB\Collection::bulkWrite()
Наследование: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $databaseName, string $collectionName, array $operations, array $options = [] ) Constructs a bulk write operation.
execute ( MongoDB\Driver\Server $server ) : BulkWriteResult Execute the operation.

Описание методов

__construct() публичный метод

Example array structure for all supported operation types: [ [ 'deleteMany' => [ $filter ] ], [ 'deleteOne' => [ $filter ] ], [ 'insertOne' => [ $document ] ], [ 'replaceOne' => [ $filter, $replacement, $options ] ], [ 'updateMany' => [ $filter, $update, $options ] ], [ 'updateOne' => [ $filter, $update, $options ] ], ] Arguments correspond to the respective Operation classes; however, the writeConcern option is specified for the top-level bulk write operation instead of each individual operation. Supported options for replaceOne, updateMany, and updateOne operations: * upsert (boolean): When true, a new document is created if no document matches the query. The default is false. Supported options for the bulk write operation: * bypassDocumentValidation (boolean): If true, allows the write to opt out of document level validation. * ordered (boolean): If true, when an insert fails, return without performing the remaining writes. If false, when a write fails, continue with the remaining writes, if any. The default is true. * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
public __construct ( string $databaseName, string $collectionName, array $operations, array $options = [] )
$databaseName string Database name
$collectionName string Collection name
$operations array List of write operations
$options array Command options

execute() публичный метод

Execute the operation.
См. также: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : BulkWriteResult
$server MongoDB\Driver\Server
Результат Phalcon\Db\Adapter\MongoDB\BulkWriteResult