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
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 —__debugInfo()
Return the collection info as an array.
public
__debugInfo() : array<string|int, mixed>
Tags
Return values
array<string|int, 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 —isSparse()
Return whether this is a sparse index.
public
isSparse() : bool
Tags
Return values
bool —isText()
Return whether or not this index is of type text.
public
isText() : bool
Return values
bool —isTtl()
Return whether this is a TTL index.
public
isTtl() : bool
Tags
Return values
bool —isUnique()
Return whether this is a unique index.
public
isUnique() : bool
Tags
Return values
bool —offsetExists()
Check whether a field exists in the index information.
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Tags
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
Return values
mixed —offsetSet()
Not supported.
public
offsetSet(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
Tags
Return values
void —offsetUnset()
Not supported.
public
offsetUnset(mixed $key) : void
Parameters
- $key : mixed