PHP Class MongoWriteBatch

See also: http://php.net/manual/en/class.mongowritebatch.php
Inheritance: use trait Alcaeus\MongoDbAdapter\Helper\WriteConcernConverter
Exibir arquivo Open project: alcaeus/mongo-php-adapter Class Usage Examples

Public Methods

Method Description
add ( array | object $item ) : boolean Adds a write operation to a batch
execute ( array $writeOptions = [] ) : array Executes a batch of write operations

Protected Methods

Method Description
__construct ( MongoCollection $collection, integer $batchType, array $writeOptions ) Creates a new batch of write operations

Private Methods

Method Description
addItem ( array $item )
convertWriteErrors ( MongoDB\Driver\WriteResult $result ) : array
validate ( array $item )

Method Details

__construct() protected method

Creates a new batch of write operations
See also: http://php.net/manual/en/mongowritebatch.construct.php
protected __construct ( MongoCollection $collection, integer $batchType, array $writeOptions )
$collection MongoCollection
$batchType integer
$writeOptions array

add() public method

Adds a write operation to a batch
See also: http://php.net/manual/en/mongowritebatch.add.php
public add ( array | object $item ) : boolean
$item array | object
return boolean

execute() final public method

Executes a batch of write operations
See also: http://php.net/manual/en/mongowritebatch.execute.php
final public execute ( array $writeOptions = [] ) : array
$writeOptions array
return array