- 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
$key
parameter forMongoDB\Collection::createIndex()
.
Return Values
The index specification as an associative array.
Examples
The output would then resemble:
See Also
MongoDB\Collection::createIndex()
- listIndexes command reference in the MongoDB manual