Navigation

MongoDB\Model\CollectionInfo::getType()

New in version 1.9.

Definition

MongoDB\Model\CollectionInfo::getType

Return the collection type.

function getType(): string

Return Values

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

Examples

<?php

$info = new CollectionInfo(['type' => 'collection', 'name' => 'foo']);

echo $info->getType();

The output would then resemble:

collection

See Also