バージョン1.9の新機能。
定義
Return Values
コレクションに関する追加情報を含む配列。 これは、 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 viewforeach ($db->listCollections(['filter' => ['name' => 'myView']]) as $info) { var_dump($info->getInfo());}出力は次のようになります。
array(1) { ["readOnly"]=> bool(true)}その他の参照
MongoDB マニュアルのlistCollectionsコマンド参照