Learn the "why" behind slow queries and how to fix them in our 2-Part Webinar.
Register now >
Docs Menu
Docs Home
/ /

MongoDB\GridFS\Bucket::getDatabaseName()

MongoDB\GridFS\Bucket::getDatabaseName()

Returns the name of the database containing this bucket.

function getDatabaseName(): string

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

<?php
$bucket = (new MongoDB\Client)->test->selectGridFSBucket();
var_dump($bucket->getDatabaseName());

The output would then resemble:

string(4) "test"

Back

getChunkSizeBytes()

On this page