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

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 viewforeach ($db->listCollections(['filter' => ['name' => 'myView']]) as $info) { var_dump($info->getInfo());}

出力は次のようになります。

array(1) { ["readOnly"]=> bool(true)}