Phalcon\Db\Adapter\MongoDB\Collection::findOneAndDelete PHP Method

findOneAndDelete() public method

The document to return may be null if no document matched the filter. Note: BSON deserialization of the returned document does not yet support a custom type map (depends on: https://jira.mongodb.org/browse/PHPC-314).
See also: FindOneAndDelete::__construct() for supported options
See also: http://docs.mongodb.org/manual/reference/command/findAndModify/
public findOneAndDelete ( array | object $filter, array $options = [] ) : object | null
$filter array | object Query by which to filter documents
$options array Command options
return object | null
    public function findOneAndDelete($filter, array $options = [])
    {
        $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
        if (!isset($options['writeConcern']) && Functions::serverSupportsFeature($server, self::$wireVersionForFindAndModifyWriteConcern)) {
            $options['writeConcern'] = $this->writeConcern;
        }
        $operation = new FindOneAndDelete($this->databaseName, $this->collectionName, $filter, $options);
        return $operation->execute($server);
    }