Phalcon\Db\Adapter\MongoDB\Operation\ReplaceOne::__construct PHP Method

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