또한 보기: MongoDB\Collection::bulkWrite()
상속: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
예제 #1
0
 /**
  * Executes multiple write operations.
  *
  * @see BulkWrite::__construct() for supported options
  *
  * @param array[] $operations List of write operations
  * @param array   $options Command options
  *
  * @return BulkWriteResult
  */
 public function bulkWrite(array $operations, array $options = [])
 {
     if (!isset($options['writeConcern'])) {
         $options['writeConcern'] = $this->writeConcern;
     }
     $operation = new BulkWrite($this->databaseName, $this->collectionName, $operations, $options);
     $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
     return $operation->execute($server);
 }