How to prevent pymongo duplicate key error for id

12/5/2019

I have 10 python processes that import data in mongodb using pymongo and run in kubernetes. They process around 300 to 600 files per second, and they occasionally die with duplicate key error for _id. Is there any way I can prevent this error from appearing, like increasing the randomness of _id ?

-- Adrian
kubernetes
mongodb
pymongo

0 Answers