찾다

 >  Q&A  >  본문

pymongo遍历文档

cuments = collection.find_all()for document in documents:

   # 解析document的函数

数据量300万
到后面越来越慢
请问如何批量取数据

手机码字,敬请见谅


高洛峰高洛峰3039일 전683

모든 응답(1)나는 대답할 것이다

  • 三叔

    三叔2016-11-05 13:14:02

    不太确定文件是什么样子的,给出一个普通的解法

    with open(filename,'r') as documents:
        for document in documents:
            print document


    회신하다
    0
  • 취소회신하다