Menu Docs

MongoDB\GridFS\Bucket::getBucketName()

MongoDB\GridFS\Bucket::getBucketName()

Retorna o nome desse bucket.

function getBucketName(): string

O nome deste bucket como uma string.

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

A saída seria então semelhante a:

string(2) "fs"