Docs Menu

Docs HomePHP Library Manual


On this page

  • Definition
  • Return Values
  • Examples
  • See Also

Return the index namespace, which is the namespace of the collection containing the index.

function getNamespace(): string

The index namespace.

$info = new IndexInfo([
'ns' => '',
echo $info->getNamespace();

The output would then resemble:
  • MongoDB\Collection::createIndex()

  • MongoDB\Collection::getNamespace()

  • listIndexes command reference in the MongoDB manual

← MongoDB\Model\IndexInfo::getName()