Creating an index with dropDups shouldn't assert

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.9.2
    • Affects Version/s: 1.7.2
    • Component/s: Index Maintenance
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      > db.g.save({a: 1})
      > db.g.save({a: 1})
      > db.g.find()
      { "_id" : ObjectId("4cd05a0ae109fa5c133e277a"), "a" : 1 }
      { "_id" : ObjectId("4cd05a0be109fa5c133e277b"), "a" : 1 }
      > db.g.ensureIndex({a: 1}, {unique: true, dropDups: true})
      E11000 duplicate key error index: test.g.$a_1  dup key: { : 1.0 }
      > db.g.find()
      { "_id" : ObjectId("4cd05a0ae109fa5c133e277a"), "a" : 1 }
      

      If the user specifies dropDups: true, there's no reason for the server to assert. This is a problem in the drivers, where we check for assertions when creating indexes.

            Assignee:
            Aaron Staple (Inactive)
            Reporter:
            Kyle Banker (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: