バージョン1.9の新機能。
定義
Return Values
_idインデックスに関する情報を含む配列。 これは、 listCollectionsコマンドの応答で返されるidIndexフィールドに対応します。
例
$db = (new MongoDB\Client)->test;
$db->createCollection('myCollection');
// Retrieves the _id index informationforeach ($db->listCollections(['filter' => ['name' => 'myCollection']]) as $info) { var_dump($info->getIdIndex());}出力は次のようになります。
array(3) { 'v' => int(2) 'key' => array(1) { '_id' => int(1) } 'name' => string(4) "_id_"}その他の参照
MongoDB マニュアルのlistCollectionsコマンド参照