For examples:
doc1:{
'name':'apple'
}
doc2:
{
'name':'apple juice'
}
when I create text index with pymongo:
db.products_collection.create_index([('name', TEXT)],
unique=True,
background=True)
it give me an error:
E11000 duplicate key error collection: c.items_collection index: name_text_alias_text dup key: { : "apple", : 10.5 }
Some one know why? I cannot add unique=True
for text string?
apple
andapple juice
are two different values. They can not cause your error, you should check your db for any occurrences – kkkkkkk