You are viewing an offline version of MongoDB documentation. Some page features might be unavailable. To view the latest version of the page or use interactive features, visit the live page.
MongoDB\Model\IndexInfo::getName()
Definition
MongoDB\Model\IndexInfo::getName()Return the index name. This correlates with the return value of
MongoDB\Collection::createIndex(). An index name may be derived from the$keyparameter or explicitly specified via thenameoption.function getName(): string
Return Values
The index name.
Examples
$info = new IndexInfo([ 'name' => 'x_1', ]); echo $info->getName();
The output would then resemble:
x_1
See Also
listIndexes command reference in the MongoDB manual