PHP Класс Phalcon\Db\Adapter\MongoDB\Operation\FindOneAndUpdate

См. также: MongoDB\Collection::findOneAndUpdate()
См. также: http://docs.mongodb.org/manual/reference/command/findAndModify/
Наследование: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $databaseName, string $collectionName, array | object $filter, array | object $update, array $options = [] ) Constructs a findAndModify command for updating a document.
execute ( MongoDB\Driver\Server $server ) : object | null Execute the operation.

Описание методов

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

Supported options: * bypassDocumentValidation (boolean): If true, allows the write to opt out of document level validation. * maxTimeMS (integer): The maximum amount of time to allow the query to run. * projection (document): Limits the fields to return for the matching document. * returnDocument (enum): Whether to return the document before or after the update is applied. Must be either FindOneAndUpdate::RETURN_DOCUMENT_BEFORE or FindOneAndUpdate::RETURN_DOCUMENT_AFTER. The default is FindOneAndUpdate::RETURN_DOCUMENT_BEFORE. * sort (document): Determines which document the operation modifies if the query selects multiple documents. * 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. This option is only supported for server versions >= 3.2.
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

execute() публичный метод

Execute the operation.
См. также: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : object | null
$server MongoDB\Driver\Server
Результат object | null