Operation for the listIndexes command.
- Full name:
\MongoDB\Operation\ListIndexes
- This class implements:
\MongoDB\Operation\Executable
See Also:
- \MongoDB\Collection::listIndexes() -
- http://docs.mongodb.org/manual/reference/command/listIndexes/ -
private static int $errorCodeDatabaseNotFound
- This property is static.
private static int $errorCodeNamespaceNotFound
- This property is static.
private string $databaseName
private string $collectionName
private array $options
Constructs a listIndexes command.
public __construct(string $databaseName, string $collectionName, array $options = []): mixed
Supported options:
-
maxTimeMS (integer): The maximum amount of time to allow the query to run.
-
session (MongoDB\Driver\Session): Client session.
Parameters:
Parameter | Type | Description |
---|---|---|
$databaseName |
string | Database name |
$collectionName |
string | Collection name |
$options |
array | Command options |
Execute the operation.
public execute(\MongoDB\Driver\Server $server): \MongoDB\Model\IndexInfoIterator
Parameters:
Parameter | Type | Description |
---|---|---|
$server |
\MongoDB\Driver\Server |
See Also:
- \MongoDB\Operation\Executable::execute() -
Create options for executing the command.
private createOptions(): array
Note: read preference is intentionally omitted, as the spec requires that the command be executed on the primary.
See Also:
Returns information for all indexes for this collection using the listIndexes command.
private executeCommand(\MongoDB\Driver\Server $server): \MongoDB\Model\IndexInfoIteratorIterator
Parameters:
Parameter | Type | Description |
---|---|---|
$server |
\MongoDB\Driver\Server |