AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

MongoDB\Model\CollectionInfo::getInfo()

1.9バージョン の新機能。:

MongoDB\Model\CollectionInfo::getInfo()

コレクションに関する追加情報を返します。

function getInfo(): array

コレクションに関する追加情報を含む配列。 これは、 listCollectionsコマンドの応答で返されるinfoフィールドに対応します。

<?php
$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)
}