- 连接+查询
- 带认证数据库
from pymongo import MongoClient as MC
client = MC("mongodb://root:passwd@192.168.10.100:27017/?authSource=admin")
db = client.db_name
col = db.col_name
condition = {"name":"cm"}
for item in col.find(condition):
print(item)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)