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

MongoDB\Model\IndexInfo::getKey()

MongoDB\Model\IndexInfo::getKey()

インデックス仕様( インデックス フィールドと順序)。 これは、MongoDB\Collection::createIndex() の$keyパラメータと相関します

function getKey(): array

連想配列としてのインデックス仕様。

<?php $info = new IndexInfo([ 'key' => ['x' => 1],]); var_dump($info->getKey());

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

array(1) { ["x"]=> int(1)}