Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3590

v1 indexes don't report their _id in getIndexes()

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 1.9.1
    • Index Maintenance
    • None
    • Tested on vista 64
    • ALL

    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.

      Attachments

        Activity

          People

            dwight@mongodb.com Dwight Merriman
            cwestin Chris Westin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: