Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\DatabaseInfo::getName()

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

On this page