python BulkWriteError: batch op errors occurred
来源:互联网 发布:php登陆页面完整代码 编辑:程序博客网 时间:2024/04/29 04:45
在insert_many 的时候遇到如下错误
File "C:/Users/Administrator/PycharmProjects/untitled/UrlLibTest.py", line 62, in <module>
FundUtil.FundUtil.getAllFundOneDayData()File "C:\Users\Administrator\PycharmProjects\untitled\FundUtil.py", line 90, in getAllFundOneDayData
MongoUtil.MongoUtil.doInsert(documents);
File "C:\Users\Administrator\PycharmProjects\untitled\MongoUtil.py", line 13, in doInsert
funDTable.insert_many(documents);
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\pymongo\collection.py", line 724, in insert_many
blk.execute(self.write_concern.document)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\pymongo\bulk.py", line 495, in execute
return self.execute_legacy(sock_info, generator, write_concern)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\pymongo\bulk.py", line 462, in execute_legacy
raise BulkWriteError(full_result)
pymongo.errors.BulkWriteError: batch op errors occurre
原因:插入的时候有唯一索引重复了。。。
检查插入的数据或者去掉该索引即可
阅读全文
0 0
- python BulkWriteError: batch op errors occurred
- Multiple Errors have Occurred
- Errors occurred during the build
- Errors occurred during the build.
- Errors occurred during the build.
- Errors occurred during the build.
- “Errors occurred during the build.
- Errors occurred during the build
- Errors occurred during the build
- Errors occurred during the build.
- Errors occurred during the build.
- Errors occurred during the build.
- Errors occurred during the build.
- Errors occurred during the build
- Errors occurred during the build.
- Errors occurred during the build.
- Errors occurred during the build
- 遇到一个错误 Errors occurred during the build. Errors occurred during the build. Errors running builder
- SQL数据还原
- ReentrantReadWriteLock
- 摩尔定律要失效了吗?
- 机器学习基石-The theory of generation
- C语言---函数
- python BulkWriteError: batch op errors occurred
- RHce端口的web服务
- hibernate的事务(七)
- HDOJ2090 算菜价
- Python+腾讯云搭建微信公众号
- 众数问题(递归、分治)
- shell并发编程
- redis实现分布式锁
- kafka_2.11-0.8.2.1生产者producer的Java实现