Documentation

ListIndexes
in package

FinalYes

Operation for the listIndexes command.

Tags
see
Collection::listIndexes()
see
https://mongodb.com/docs/manual/reference/command/listIndexes/

Table of Contents

Constants

ERROR_CODE_DATABASE_NOT_FOUND  = 60
ERROR_CODE_NAMESPACE_NOT_FOUND  = 26

Properties

$collectionName  : string
$databaseName  : string
$options  : array<string|int, mixed>

Methods

__construct()  : mixed
Constructs a listIndexes command.
execute()  : Iterator<int, IndexInfo>
Execute the operation.
createOptions()  : array<string|int, mixed>
Create options for executing the command.

Constants

ERROR_CODE_DATABASE_NOT_FOUND

private mixed ERROR_CODE_DATABASE_NOT_FOUND = 60

ERROR_CODE_NAMESPACE_NOT_FOUND

private mixed ERROR_CODE_NAMESPACE_NOT_FOUND = 26

Properties

$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:

  • 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.

  • session (MongoDB\Driver\Session): Client session.

Parameters
$databaseName : string

Database name

$collectionName : string

Collection name

$options : array<string|int, mixed> = []

Command options

Tags
throws
InvalidArgumentException

for parameter/option parsing errors

execute()

Execute the operation.

public execute(Server $server) : Iterator<int, IndexInfo>
Parameters
$server : Server
Tags
throws
RuntimeException

for other driver errors (e.g. connection errors)

Return values
Iterator<int, IndexInfo>

        
On this page

Search results