Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\DatabaseInfo::getName()

On this page

  • Definition
  • Return Values
  • Examples
  • See Also
MongoDB\Model\DatabaseInfo::getName()

Return the database name.

function getName(): string

The database name.

<?php
$info = new DatabaseInfo(['name' => 'foo']);
echo $info->getName();

The output would then resemble:

foo
  • MongoDB\Database::getDatabaseName()

  • listDatabases command reference in the MongoDB manual

Back

DatabaseInfo