ListIndexes
in package
implements
Executable
Operation for the listIndexes command.
Tags
Interfaces, Classes, Traits and Enums
- Executable
Table of Contents
- $collectionName : string
- $databaseName : string
- $errorCodeDatabaseNotFound : int
- $errorCodeNamespaceNotFound : int
- $options : array<string|int, mixed>
- __construct() : mixed
- Constructs a listIndexes command.
- execute() : IndexInfoIterator
- Execute the operation.
- createOptions() : array<string|int, mixed>
- Create options for executing the command.
- executeCommand() : IndexInfoIteratorIterator
- Returns information for all indexes for this collection using the listIndexes command.
Properties
$collectionName
private
string
$collectionName
$databaseName
private
string
$databaseName
$errorCodeDatabaseNotFound
private
static int
$errorCodeDatabaseNotFound
= 60
$errorCodeNamespaceNotFound
private
static int
$errorCodeNamespaceNotFound
= 26
$options
private
array<string|int, mixed>
$options
Methods
__construct()
Constructs a listIndexes command.
public
__construct(string $databaseName, string $collectionName[, array<string|int, mixed> $options = [] ]) : mixed
Supported options:
-
maxTimeMS (integer): The maximum amount of time to allow the query to run.
-
session (MongoDB\Driver\Session): Client session.
Parameters
- $databaseName : string
-
Database name
- $collectionName : string
-
Collection name
- $options : array<string|int, mixed> = []
-
Command options
Tags
Return values
mixed —execute()
Execute the operation.
public
execute(Server $server) : IndexInfoIterator
Parameters
- $server : Server
Tags
Return values
IndexInfoIterator —createOptions()
Create options for executing the command.
private
createOptions() : array<string|int, mixed>
Note: read preference is intentionally omitted, as the spec requires that the command be executed on the primary.
Tags
Return values
array<string|int, mixed> —executeCommand()
Returns information for all indexes for this collection using the listIndexes command.
private
executeCommand(Server $server) : IndexInfoIteratorIterator
Parameters
- $server : Server