[SERVER-3590] v1 indexes don't report their _id in getIndexes() Created: 12/Aug/11  Updated: 29/Aug/11  Resolved: 19/Aug/11

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 1.9.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Chris Westin Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested on vista 64


Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

Following on from the test statements executed at the top of SERVER-3589 .

With the downgraded mongod (as per 3589, downgraded from 1.9.3 to 1.8.2), I created another index on the idx1 collection. Then I used getIndexes() to see what I have:

> db.idx1.ensureIndex(

{b:1}

);
> db.idx1.getIndexes();
[
{
"v" : 1,
"key" :

{ "_id" : 1 }

,
"ns" : "qadb.idx1",
"name" : "id"
},
{
"v" : 1,
"key" :

{ "a" : 1, "b" : 1 }

,
"ns" : "qadb.idx1",
"name" : "a_1_b_1"
},
{
"_id" : ObjectId("4e4596b57e3d39fef5458dfd"),
"ns" : "qadb.idx1",
"key" :

{ "b" : 1 }

,
"name" : "b_1",
"v" : 0
}
]
>

The b_1 index created with the older server reports an _id, which the newer v:1 indexes do not. This seems like an incorrect non-backwards compatible change – the newer indexes should still have _ids.


Generated at Thu Feb 08 03:03:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.