Phalcon\Db\Adapter\MongoDB\Operation\UpdateOne::__construct PHP Метод

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

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 document
$options array Command options
    public function __construct($databaseName, $collectionName, $filter, $update, array $options = [])
    {
        if (!is_array($update) && !is_object($update)) {
            throw InvalidArgumentException::invalidType('$update', $update, 'array or object');
        }
        if (!Functions::isFirstKeyOperator($update)) {
            throw new InvalidArgumentException('First key in $update argument is not an update operator');
        }
        $this->update = new Update($databaseName, $collectionName, $filter, $update, ['multi' => false] + $options);
    }