Documentation

IndexInfo
in package
implements ArrayAccess

Index information model class.

This class models the index information returned by the listIndexes command or, for legacy servers, queries on the "system.indexes" collection. It provides methods to access common index options, and allows access to other options through the ArrayAccess interface (write methods are not supported). For information on keys and index options, see the referenced db.collection.createIndex() documentation.

Tags
see
Collection::listIndexes()
see
https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst
see
http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/

Interfaces, Classes, Traits and Enums

ArrayAccess

Table of Contents

$info  : array<string|int, mixed>
__construct()  : mixed
__debugInfo()  : array<string|int, mixed>
Return the collection info as an array.
__toString()  : string
Return the index name to allow casting IndexInfo to string.
getKey()  : array<string|int, mixed>
Return the index key.
getName()  : string
Return the index name.
getNamespace()  : string
Return the index namespace (e.g. "db.collection").
getVersion()  : int
Return the index version.
is2dSphere()  : bool
Return whether or not this index is of type 2dsphere.
isGeoHaystack()  : bool
Return whether or not this index is of type geoHaystack.
isSparse()  : bool
Return whether this is a sparse index.
isText()  : bool
Return whether or not this index is of type text.
isTtl()  : bool
Return whether this is a TTL index.
isUnique()  : bool
Return whether this is a unique index.
offsetExists()  : bool
Check whether a field exists in the index information.
offsetGet()  : mixed
Return the field's value from the index information.
offsetSet()  : void
Not supported.
offsetUnset()  : void
Not supported.

Properties

$info

private array<string|int, mixed> $info

Methods

__construct()

public __construct(array<string|int, mixed> $info) : mixed
Parameters
$info : array<string|int, mixed>

Index info

Return values
mixed

__toString()

Return the index name to allow casting IndexInfo to string.

public __toString() : string
Return values
string

getKey()

Return the index key.

public getKey() : array<string|int, mixed>
Return values
array<string|int, mixed>

getName()

Return the index name.

public getName() : string
Return values
string

getNamespace()

Return the index namespace (e.g. "db.collection").

public getNamespace() : string
Return values
string

getVersion()

Return the index version.

public getVersion() : int
Return values
int

is2dSphere()

Return whether or not this index is of type 2dsphere.

public is2dSphere() : bool
Return values
bool

isGeoHaystack()

Return whether or not this index is of type geoHaystack.

public isGeoHaystack() : bool
Return values
bool

isText()

Return whether or not this index is of type text.

public isText() : bool
Return values
bool

offsetGet()

Return the field's value from the index information.

public offsetGet(mixed $key) : mixed

This method satisfies the Enumerating Indexes specification's requirement that index fields be made accessible under their original names. It may also be used to access fields that do not have a helper method.

Parameters
$key : mixed
Tags
see
http://php.net/arrayaccess.offsetget
see
https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst#getting-full-index-information
Return values
mixed

Search results