New in version 1.9.
Definition
Return Values
An array containing information on the _id index. This corresponds to the idIndex field returned in the listCollections command reply.
Examples
$db = (new MongoDB\Client)->test;
$db->createCollection('myCollection');
// Retrieves the _id index informationforeach ($db->listCollections(['filter' => ['name' => 'myCollection']]) as $info) { var_dump($info->getIdIndex());}The output would then resemble:
array(3) { 'v' => int(2) 'key' => array(1) { '_id' => int(1) } 'name' => string(4) "_id_"}See Also
listCollections command reference in the MongoDB manual