PHP Class Phalcon\Db\Adapter\MongoDB\Operation\UpdateMany

See also: MongoDB\Collection::updateMany()
See also: http://docs.mongodb.org/manual/reference/command/update/
Inheritance: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
Show file Open project: phalcon/incubator Class Usage Examples

Public Methods

Method Description
__construct ( string $databaseName, string $collectionName, array | object $filter, array | object $update, array $options = [] ) Constructs an update command.
execute ( MongoDB\Driver\Server $server ) : UpdateResult Execute the operation.

Method Details

__construct() public method

Supported options: * bypassDocumentValidation (boolean): If true, allows the write to opt out of document level validation. * upsert (boolean): When true, a new document is created if no document matches the query. The default is false. * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
public __construct ( string $databaseName, string $collectionName, array | object $filter, array | object $update, array $options = [] )
$databaseName string Database name
$collectionName string Collection name
$filter array | object Query by which to filter documents
$update array | object Update to apply to the matched documents
$options array Command options

execute() public method

Execute the operation.
See also: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : UpdateResult
$server MongoDB\Driver\Server
return Phalcon\Db\Adapter\MongoDB\UpdateResult