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

MongoDB\Model\IndexInfo::is2dSphere()

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

MongoDB\Model\IndexInfo::is2dSphere()

インデックスが2 dsphereインデックスであるかどうかを返します。

function is2dSphere(): boolean

インデックスが 2dsphere インデックスかどうかを示すブール値。

<?php
$collection = (new MongoDB\Client)->getCollection('test', 'places');
$collection->createIndex(['pos' => '2dsphere']);
foreach ($collection->listIndexes() as $index) {
if ($index->is2dSphere()) {
printf("%s has 2dsphereIndexVersion: %d\n", $index->getName(), $index['2dsphereIndexVersion']);
}
}

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

pos_2dsphere has 2dsphereIndexVersion: 3