IndexInfo
in package
implements
ArrayAccess, Stringable
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
Table of Contents
Interfaces
- ArrayAccess
- Stringable
Properties
- $info : array<string|int, mixed>
Methods
- __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.
- getVersion() : int
- Return the index version.
- is2dSphere() : bool
- Return whether or not this index is of type 2dsphere.
- 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
__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
stringgetKey()
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
stringgetVersion()
Return the index version.
public
getVersion() : int
Return values
intis2dSphere()
Return whether or not this index is of type 2dsphere.
public
is2dSphere() : bool
Return values
boolisSparse()
Return whether this is a sparse index.
public
isSparse() : bool
Tags
Return values
boolisText()
Return whether or not this index is of type text.
public
isText() : bool
Return values
boolisTtl()
Return whether this is a TTL index.
public
isTtl() : bool
Tags
Return values
boolisUnique()
Return whether this is a unique index.
public
isUnique() : bool
Tags
Return values
booloffsetExists()
Check whether a field exists in the index information.
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Tags
Return values
booloffsetGet()
Return the field's value from the index information.
public
offsetGet(mixed $offset) : 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
- $offset : mixed
Tags
offsetSet()
Not supported.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Tags
offsetUnset()
Not supported.
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed