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

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

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

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

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

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

Supported options: * comment (string): Attaches a comment to the query. If "$comment" also exists in the modifiers document, this option will take precedence. * maxTimeMS (integer): The maximum amount of time to allow the query to run. If "$maxTimeMS" also exists in the modifiers document, this option will take precedence. * modifiers (document): Meta-operators modifying the output or behavior of a query. * projection (document): Limits the fields to return for the matching document. * readConcern (MongoDB\Driver\ReadConcern): Read concern. For servers < 3.2, this option is ignored as read concern is not available. * readPreference (MongoDB\Driver\ReadPreference): Read preference. * skip (integer): The number of documents to skip before returning. * sort (document): The order in which to return matching documents. If "$orderby" also exists in the modifiers document, this option will take precedence. * typeMap (array): Type map for BSON deserialization.
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

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

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