我正在编写一个python代码来更新集合中的每个文档。我的代码是:
for r, d_50 in enumerate(grid50.find().batch_size(500)):
self_grid = grid50.find({'_id':d_50['_id']})
.....
.....
(processing process)
grid50.update({'_id':d_50['_id']},{'$set':{u'big_cell8':{"POI":venue_count, "cell_ids":cell_ids}}})
但是,当我运行此代码时,遇到了一个问题:
^{pr2}$有人知道如何处理这个问题吗?我应该在代码中添加一些东西来处理这个问题吗?在
从PyMongoDocs-
基本上,您必须处理这个异常,以便应用程序重新连接到mongo并重新运行失败的函数。。在
相关问题 更多 >
编程相关推荐