我已经查看了其他解决方案,例如:
但是还是有这个错误。我正在尝试将大型 GeoJSON 文件加载到 MongoDB 中。
这是我的代码:https ://gist.github.com/mittenchops/6499844
在此处使用迭代 json 解析器:https ://github.com/isagalaev/ijson
这是我的错误:
Traceback (most recent call last):
File "upload2mongo.py", line 57, in <module>
main(sys.argv)
File "upload2mongo.py", line 52, in main
loader(renamesh2json(argv[1]), argv[2])
File "upload2mongo.py", line 22, in loader
db[collection].insert(d)
File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 359, in insert
continue_on_error, self.__uuid_subtype), safe)
File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 853, in _send_message
raise AutoReconnect(str(e))
pymongo.errors.AutoReconnect: [Errno 104] Connection reset by peer
为什么我会收到这个关于我的连接关闭的奇怪错误?