-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.7.2
-
Component/s: Index Maintenance
-
None
-
ALL
> 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.
- is duplicated by
-
SERVER-2580 ensureIndex with unique:true and dropDups:true fails if duplicate data present
- Closed