python连接、查询mongo数据库-pymongo
版本不兼容问题:指定安装对应版本进行兼容
pip install pymongo==3.10.1
写代码
import pymongo
def findAndImport():
# 查询mongo的数据
client = MongoClient("mongodb://ip:27017/")
database = client["库名"]
collection = database["表名"]
#接下来就可以查询啦!
# Created with Studio 3T, the IDE for MongoDB - https://studio3t.com/
#一般工具都提供了转换mongo查询语句的功能