Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\CollectionInfo::getName()

On this page

  • Definition
  • Return Values
  • Examples
  • See Also
MongoDB\Model\CollectionInfo::getName()

Return the collection name.

function getName(): string

The collection name. This corresponds to the name field returned in the listCollections command reply.

<?php
$info = new CollectionInfo(['name' => 'foo']);
echo $info->getName();

The output would then resemble:

foo
  • MongoDB\Collection::getCollectionName()

  • listCollections command reference in the MongoDB manual

Back

getInfo()

Next

getOptions()