You are viewing an offline version of MongoDB documentation. Some page features might be unavailable. To view the latest version of the page or use interactive features, visit the live page.
MongoDB\Model\CollectionInfo::getIdIndex()
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
$info = new CollectionInfo([ 'type' => 'view', 'name' => 'foo', 'idIndex' => [ 'v' => 2, 'key' => ['_id' => 1], 'name' => '_id', 'ns' => 'test.foo', ], ]); var_dump($info->getIdIndex());
The output would then resemble:
array(4) { ["v"]=> int(2) ["key"]=> array(1) { ["_id"]=> int(1) } ["name"]=> string(3) "_id" ["ns"]=> string(8) "test.foo" }
See Also
listCollections command reference in the MongoDB manual