PHP Class Phalcon\Db\Adapter\MongoDB\Operation\FindAndModify

This class is used internally by the FindOneAndDelete, FindOneAndReplace, and FindOneAndUpdate operation classes.
See also: http://docs.mongodb.org/manual/reference/command/findAndModify/
Inheritance: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
Datei anzeigen Open project: phalcon/incubator

Public Methods

Method Description
__construct ( string $databaseName, string $collectionName, array $options ) Constructs a findAndModify command.
execute ( MongoDB\Driver\Server $server ) : object | null Execute the operation.

Private Methods

Method Description
createCommand ( MongoDB\Driver\Server $server ) : MongoDB\Driver\Command Create the findAndModify command.

Method Details

__construct() public method

Supported options: * bypassDocumentValidation (boolean): If true, allows the write to opt out of document level validation. * fields (document): Limits the fields to return for the matching document. * maxTimeMS (integer): The maximum amount of time to allow the query to run. * new (boolean): When true, returns the modified document rather than the original. This option is ignored for remove operations. The The default is false. * query (document): Query by which to filter documents. * remove (boolean): When true, removes the matched document. This option cannot be true if the update option is set. The default is false. * sort (document): Determines which document the operation modifies if the query selects multiple documents. * update (document): Update or replacement to apply to the matched document. This option cannot be set if the remove option is true. * upsert (boolean): When true, a new document is created if no document matches the query. This option is ignored for remove operations. 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 $options )
$databaseName string Database name
$collectionName string Collection name
$options array Command options

execute() public method

Execute the operation.
See also: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : object | null
$server MongoDB\Driver\Server
return object | null