📜  mongodb python 获取所有文档 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:51.207000             🧑  作者: Mango

代码示例1
from pymongo import MongoClient

if __name__ == '__main__':
    client = MongoClient("localhost", 27017, maxPoolSize=50)
    db = client.localhost
    collection = db['chain']
    cursor = collection.find({})
    for document in cursor:
          print(document)