バージョン 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 view foreach ($db->listCollections(['filter' => ['name' => 'myView']]) as $info) { var_dump($info->getInfo()); }
出力は次のようになります。
array(1) { ["readOnly"]=> bool(true) }
その他の参照
MongoDB マニュアルのlistCollectionsコマンド参照