Phalcon\Db\Adapter\MongoDB\Operation\UpdateMany::execute PHP Метод

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

Execute the operation.
См. также: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : UpdateResult
$server MongoDB\Driver\Server
Результат Phalcon\Db\Adapter\MongoDB\UpdateResult
    public function execute(Server $server)
    {
        return $this->update->execute($server);
    }

Usage Example

Пример #1
0
 /**
  * Updates all documents matching the filter.
  *
  * @see UpdateMany::__construct() for supported options
  * @see http://docs.mongodb.org/manual/reference/command/update/
  *
  * @param array|object $filter Query by which to filter documents
  * @param array|object $update Update to apply to the matched documents
  * @param array        $options Command options
  *
  * @return UpdateResult
  */
 public function updateMany($filter, $update, array $options = [])
 {
     if (!isset($options['writeConcern'])) {
         $options['writeConcern'] = $this->writeConcern;
     }
     $operation = new UpdateMany($this->databaseName, $this->collectionName, $filter, $update, $options);
     $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
     return $operation->execute($server);
 }