本页内容
MongoDB\Database::getDatabaseName()
返回此数据库的名称。
function getDatabaseName(): string
作为字符串的此数据库的名称。
以下示例打印数据库对象的名称
<?php$db = (new MongoDB\Client)->test;echo $db->getDatabaseName();
输出结果将类似
test
返回
dropCollection()
下一步
getManager()