- Reference >
- Enumeration Classes >
- MongoDB\Model\IndexInfo::getKey()
MongoDB\Model\IndexInfo::getKey()
On this page
Definition
-
MongoDB\Model\IndexInfo::getKey Return the index specification (i.e. indexed field(s) and order). This correlates with the
$keyparameter forMongoDB\Collection::createIndex().
Return Values
The index specification as an associative array.
Examples
The output would then resemble:
array(1) {
["x"]=>
int(1)
}
See Also
MongoDB\Collection::createIndex()- listIndexes command reference in the MongoDB manual