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

__construct() public method

Supported options: * maxTimeMS (integer): The maximum amount of time to allow the query to run. * projection (document): Limits the fields to return for the matching document. * sort (document): Determines which document the operation modifies if the query selects multiple documents. * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This option is only supported for server versions >= 3.2.
public __construct ( string $databaseName, string $collectionName, array | object $filter, array $options = [] )
$databaseName string Database name
$collectionName string Collection name
$filter array | object Query by which to filter documents
$options array Command options
    public function __construct($databaseName, $collectionName, $filter, array $options = [])
    {
        if (!is_array($filter) && !is_object($filter)) {
            throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object');
        }
        if (isset($options['projection']) && !is_array($options['projection']) && !is_object($options['projection'])) {
            throw InvalidArgumentException::invalidType('"projection" option', $options['projection'], 'array or object');
        }
        if (isset($options['projection'])) {
            $options['fields'] = $options['projection'];
        }
        unset($options['projection']);
        $this->findAndModify = new FindAndModify($databaseName, $collectionName, ['query' => $filter, 'remove' => true] + $options);
    }
FindOneAndDelete