1.9版本新增。
定义
Return Values
集合类型。 这对应于listCollections命令回复中返回的type字段。
示例
$db = (new MongoDB\Client)->test;
$db->createCollection('myCollection');
// Retrieves the collection typeforeach ($db->listCollections(['filter' => ['name' => 'myCollection']]) as $info) { echo $info->getType();}而输出将类似如下所示:
collection另请参阅
MongoDB 手册中的listCollections命令参考