MongoDB\Collection::getCollectionName()
Returns the name of this collection.
function getCollectionName(): string
The name of this collection as a string.
The following returns the collection name for the zips collection in the test database.
zips
test
<?php$collection = (new MongoDB\Client)->test->zips;echo $collection->getCollectionName();
The output would then resemble:
MongoDB\Collection::getDatabaseName()
MongoDB\Collection::getNamespace()
Back
findOneAndUpdate()
Next
getDatabaseName()
On this page