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

See also: MongoDB\Collection::count()
See also: http://docs.mongodb.org/manual/reference/command/count/
Inheritance: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
显示文件 Open project: phalcon/incubator Class Usage Examples

Public Methods

Method Description
__construct ( string $databaseName, string $collectionName, array | object $filter = [], array $options = [] ) Constructs a count command.
execute ( MongoDB\Driver\Server $server ) : integer Execute the operation.

Private Methods

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

Method Details

__construct() public method

Supported options: * hint (string|document): The index to use. If a document, it will be interpretted as an index specification and a name will be generated. * limit (integer): The maximum number of documents to count. * maxTimeMS (integer): The maximum amount of time to allow the query to run. * 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 the documents.
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() public method

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