0

we have replica set consisting of only mongo server 2.6 (we have upgraded a week ago) . we are running on windows server 2008 on virtual machine. Recently we have noticed rather annoying issue: we have a collection called items_full which has a unique index on field sku. when we run following update query:

db.items_full.update(
    {},
    { "$set":{ "ProductInfo.ProductCA.isUpdated":false } },
    { "multi": true }
)

It crashes with error:

E11000 duplicate key error index:

inventory.items_full.$sku_1 dup key: { : "DSSWI#Luc_W_Lp-12550-Gy-014-Gy" }

When I look for the above sku I get only 1 result. Any ideas?

thanks

Community
  • 1
  • 1
  • What indexes are defined for the affected collection? – WiredPrairie May 07 '14 at 11:13
  • there are 2 unique indexes (besides _id) sku and sku_upper. both have setting of drop duplicates. when i created them mongo let me do it only after i manually deleted duplicates. now if i drop one and try recreate it again - it does not let pointing at a duplicate sku but when i look for it - i do not see that it is duplicated. – Moshe Shperling May 07 '14 at 13:08
  • when you say "it crashed" -- did it actually crash or just print that duplicate error message? Can you show one of your documents (simplified)? I had tried to duplicate your scenario, and cant -- i had tried it on Mongo 2.4.9 and 2.6.0 -- but i only had 1 SKU unique key. How does sku_upper fit into this? Please print out your indexes and provide one sample document. – alernerdev May 16 '14 at 18:29

0 Answers0