亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

mongodb - Mongo insert時候出現(xiàn)duplicate key error index
ringa_lee
ringa_lee 2017-04-24 09:09:49
0
2
893

我的mongo表中沒有自己建立任何索引,只有一個mongo建立的_id索引

插入的時候有一個循環(huán),第一次insert成功了,第二次insert的時候會報錯

pymongo.errors.DuplicateKeyError: E11000 duplicate key error index: ed.uq.$_id_  dup key: { : ObjectId('539524645b8fcf3b3d6c4796') }

我的代碼是這樣的

while begin < end:
    begin += 1
    mongo.uq.insert(update_arr)

mongo的版本號是2.4.3
這個是否是mongo的bug?
這種情況應該如何解決呢?

ringa_lee
ringa_lee

ringa_lee

reply all(2)
伊謝爾倫

MongoDB’s _id cannot be repeated, it is a built-in unique index

阿神

Just clear the database.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template