Details
-
Bug
-
Resolution: Duplicate
-
Minor - P4
-
None
-
2.0.2, 2.1.0
-
None
-
OS X 64bit 2.0.1, 2.1.x nightly (2011-11-06 build); Linux 64bit 2.0.2
-
ALL
Description
test> db.things.drop()
|
true
|
test> db.things.save({"array": [ 1, 2, 3 ]})
|
test> db.things.save({"array": [ 2, 3, 4 ]})
|
test> db.things.createIndex({array: 1}, {unique: true, dropDups: true})
|
Invalid BSONObj size: -286331154 (0xEEEEEEEE) first element: _id: ObjectId('4ef8fc7f7797e97e21a8c7da')
|
but:
test> db.things.drop()
|
true
|
test> db.things.save({"array": [ 1, 2, 3 ]})
|
test> db.things.save({"array": [ 2, 3, 4 ]})
|
test> db.things.createIndex({array: 1}, {unique: true, dropDups: 1})
|
E11000 duplicate key error index: test.things.$array_1 dup key: { : 3.0 }
|
This only seems to happen if there are 2 or more duplicates in the array; with 1 duplicate, it works correctly with either true or 1 as argument to dropDups
Attachments
Issue Links
- duplicates
-
SERVER-4770 ensureIndex with unique and dropDups on multi-key field with multiple duplicates fails
-
- Closed
-