MongoDB\Collection::getCollectionName()
On this page
Definition
Return Values
The name of this collection as a string.
Example
The following returns the collection name for the zips
collection in the
test
database.
$collection = (new MongoDB\Client)->test->zips; echo $collection->getCollectionName();
The output would then resemble:
zips