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

autoIndexId:true creates a non-unique index on _id

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.1
    • Component/s: None
    • None
    • Linux

      According to http://www.mongodb.org/display/DOCS/Capped+Collections, setting autoIndexId:true should create a unique key index on the _id field (for replication of capped collections).

      My capped collection got a non-unique index on _id instead:

      > db.createCollection("myColl", {capped:true, size:536870912000, autoIndexId:true})
      { "ok" : 1 }
      > db.myColl.getIndexes()
      [
              {
                      "v" : 1,
                      "key" : {
                              "_id" : 1
                      },
                      "ns" : "dbname.myColl",
                      "name" : "_id_"
              }
      ]
      

      If the unique index on _id is no longer needed, this might be a documentation bug.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            kevin@indeed.com Kevin Kwast
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: