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

dropDups ignored on index creation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • 3.0.0
    • None
    • Index Maintenance
    • None
    • Major Change
    • ALL
    • Hide

      Create duplicate data:

          db.test.insert({ "a": 1 })
          db.test.insert({ "a": 1 })
      

      Try to create the index:

          db.test.ensureIndex({ "a": 1 },{ "unique": true, "dropDups": true })
      

      Index build fails with message:

          {
              "createdCollectionAutomatically" : false,
              "numIndexesBefore" : 1,
              "errmsg" : "exception: E11000 duplicate key error dup key: { : 1.0 }",
              "code" : 11000,
              "ok" : 0
          }
      

      Show
      Create duplicate data: db.test.insert({ "a" : 1 }) db.test.insert({ "a" : 1 }) Try to create the index: db.test.ensureIndex({ "a" : 1 },{ "unique" : true , "dropDups" : true }) Index build fails with message: { "createdCollectionAutomatically" : false , "numIndexesBefore" : 1, "errmsg" : "exception: E11000 duplicate key error dup key: { : 1.0 }" , "code" : 11000, "ok" : 0 }

    Description

      The dropDups option is being ignored and indexing fails when a key with a unique constraint contains duplicates

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              neillunn Neil Lunn
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: