本页内容
MongoDB\Collection::getDatabaseName()
返回包含此集合的数据库的名称。
function getDatabaseName(): string
包含此集合的数据库的名称,作为字符串。
以下代码返回测试数据库中zips集合的数据库名称。
zips
<?php$collection = (new MongoDB\Client)->test->zips;echo $collection->getDatabaseName();
输出将类似于
test
MongoDB\Collection::getCollectionName()
MongoDB\Collection::getNamespace()
返回
getCollectionName()
下一页
getManager()