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

MongoDB\Model\IndexInfo::getNamespace()

本页内容

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

返回索引命名空间,即包含索引的集合的命名空间。

function getNamespace(): string

索引命名空间。

<?php
$info = new IndexInfo([
'ns' => 'foo.bar',
]);
echo $info->getNamespace();

输出将类似于

foo.bar
  • MongoDB Collection::createIndex()

  • MongoDB Collection::getNamespace()

  • listIndexes 命令参考,见 MongoDB 手册

返回

getName()