文档菜单
文档首页
/ / /
PHP 库手册
/ / /

MongoDB\Model\IndexInfo::getName()

本页内容

  • 定义
  • 返回值
  • 示例
  • 另请参阅
MongoDB\Model\IndexInfo::getName()

返回索引名称。这与MongoDB\Collection::createIndex()的返回值相对应。索引名称可以由$key参数派生或通过name选项显式指定。

function getName(): string

索引名称。

<?php
$info = new IndexInfo([
'name' => 'x_1',
]);
echo $info->getName();

输出将类似于

x_1
  • MongoDB\Collection::createIndex()

  • listIndexes 命令参考,见 MongoDB 手册

返回

getKey()