下载mango数据库
https://www.runoob.com/mongodb/mongodb-window-install.html
程序调用
安装依赖
pip install pymongo
简单使用
import pymongo
# Connect to MongoDB
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
# Create database
mydb = myclient["mydatabase"]
# Create collection
mycol = mydb["customers"]
# Insert document
mydict = {"name": "John", "address": "Highway 37"}
x = mycol.insert_one(mydict)
更多信息文档:
https://juejin.cn/post/6844903597465927694
https://docs.mongoing.com/the-mongo-shell