For AI agents: a documentation index is available at https://www.mongodb.com/pt-br/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

MongoDB\Model\IndexInfo::getNamespace()

MongoDB\Model\IndexInfo::getNamespace()

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

function getNamespace(): string

The index namespace.

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

The output would then resemble:

foo.bar