1.9 版本中的新功能。
定义
Return Values
包含有关collection的额外信息的数组。这对应于listCollections命令回复中返回的info字段。
示例
$db = (new MongoDB\Client)->test; // Creates a view with the readOnly option set to "true" $db->createCollection(    'myView',    ['viewOn' => 'myCollection'],    ['readOnly' => true] ); // Retrieves information about the collection view foreach ($db->listCollections(['filter' => ['name' => 'myView']]) as $info) {    var_dump($info->getInfo()); } 
而输出将类似如下所示:
array(1) {   ["readOnly"]=>   bool(true) } 
另请参阅
- MongoDB 手册中的listCollections命令参考