update : 2015.11.03
php.shukuma.com검색:
|
MongoWriteBatch::execute(PECL mongo >= 1.5.0) MongoWriteBatch::execute — Executes a batch of write operations 설명
final public array MongoWriteBatch::execute
( array
$write_options
)Executes the batch of write operations. 인수
반환값Returns an array containing statistical information for the full batch. If the batch had to be split into multiple batches, the return value will aggregate the values from individual batches and return only the totals.
If the batch was empty, an array containing only the 'ok' field is returned (as
오류/예외A MongoWriteConcernException exception is thrown on failure. 예제Example #1 MongoWriteBatch::add() example Batching up multiple insert operations
<?php 위 예제의 출력: array(2) { ["nInserted"]=> int(3) ["ok"]=> bool(true) } Example #2 MongoWriteBatch::add() example Batching up multiple update operations
<?php 위 예제의 출력: array(4) { ["nMatched"]=> int(18) ["nModified"]=> int(2) ["nUpserted"]=> int(0) ["ok"]=> bool(true) } Example #3 MongoWriteBatch::add() example Batching up multiple delete operations
<?php 위 예제의 출력: array(2) { ["nRemoved"]=> int(1) ["ok"]=> bool(true) } |