Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of PHP Library Manual, refer to the upgrade documentation.

MongoDB\GridFS\Bucket::getDatabaseName()

Definition

MongoDB\GridFS\Bucket::getDatabaseName

Returns the name of the database containing this bucket.

function getDatabaseName(): string

Return Values

The name of the database containing this bucket as a string.

Examples

<?php

$bucket = (new MongoDB\Client)->test->selectGridFSBucket();

var_dump($bucket->getDatabaseName());

The output would then resemble:

string(4) "test"