EstimatedDocumentCount
in package
implements
Explainable
FinalYes
Operation for obtaining an estimated count of documents in a collection
Tags
Table of Contents
Interfaces
- Explainable
Properties
- $collectionName : string
- $databaseName : string
- $options : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructs a command to get the estimated number of documents in a collection.
- execute() : int
- Execute the operation.
- getCommandDocument() : array<string|int, mixed>
- Returns the command document for this operation.
- createCount() : Count
Properties
$collectionName
private
string
$collectionName
$databaseName
private
string
$databaseName
$options
private
array<string|int, mixed>
$options
Methods
__construct()
Constructs a command to get the estimated number of documents in a collection.
public
__construct(string $databaseName, string $collectionName[, array<string|int, mixed> $options = [] ]) : mixed
Supported options:
-
comment (mixed): BSON value to attach as a comment to this command.
This is not supported for servers versions < 4.4.
-
maxTimeMS (integer): The maximum amount of time to allow the query to run.
-
readConcern (MongoDB\Driver\ReadConcern): Read concern.
-
readPreference (MongoDB\Driver\ReadPreference): Read preference.
-
session (MongoDB\Driver\Session): Client session.
Parameters
- $databaseName : string
-
Database name
- $collectionName : string
-
Collection name
- $options : array<string|int, mixed> = []
-
Command options
Tags
execute()
Execute the operation.
public
execute(Server $server) : int
Parameters
- $server : Server
Tags
Return values
intgetCommandDocument()
Returns the command document for this operation.
public
getCommandDocument() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>createCount()
private
createCount() : Count