MongoDB\Model\IndexInfo Class

For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

MongoDB\Model\IndexInfo Class

Definition

This class models information about an index. Instances of this class are returned by traversing an Iterator, which is returned by the [MongoDB\Collection::listIndexes()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbcollection-listindexes.md#mongodb-phpmethod-phpmethod.MongoDB-Collection--listIndexes-- method.

This class implements PHP's ArrayAccess interface. This provides a mechanism for accessing index fields for which there exists no helper method. isset() may be used to check for the existence of a field before accessing it with [].

Note:

The [MongoDB\Model\IndexInfo](https://www.mongodb.com/docs/php-library/current/reference/class/mongodbmodelindexinfo.md#mongodb-phpclass-phpclass.MongoDB-Model-IndexInfo class is immutable. Attempting to modify it via the ArrayAccess interface will result in a [MongoDB\Exception\BadMethodCallException.](https://www.mongodb.com/docs/php-library/current/reference/exception-classes.md#mongodb-phpclass-phpclass.MongoDB-Exception-BadMethodCallException

Methods

  • [MongoDB\Model\IndexInfo::getKey()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-getkey.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--getKey--

  • [MongoDB\Model\IndexInfo::getName()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-getname.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--getName--

  • [MongoDB\Model\IndexInfo::getNamespace()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-getnamespace.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--getNamespace--

  • [MongoDB\Model\IndexInfo::getVersion()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-getversion.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--getVersion--

  • [MongoDB\Model\IndexInfo::is2dSphere()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-is2dsphere.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--is2dSphere--

  • [MongoDB\Model\IndexInfo::isSparse()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-issparse.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--isSparse--

  • [MongoDB\Model\IndexInfo::isText()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-istext.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--isText--

  • [MongoDB\Model\IndexInfo::isTtl()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-isttl.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--isTtl--

  • [MongoDB\Model\IndexInfo::isUnique()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbmodelindexinfo-isunique.md#mongodb-phpmethod-phpmethod.MongoDB-Model-IndexInfo--isUnique--