📜  python代码示例中的mongodb

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

代码示例1
# install the pymongo module through pip or some other package manager

from pymongo import MongoClient

client = MongoClient("") 
db = client.example_database # you can also do 'client["example_database"]'
collection = db.example_collection

for i in collection.find(): # returns a list of documents in the collection
    print(i) # print collection document