pymongo 增、删、改、查等操作
pymongo 的基本操作
1. 连接mongodb
import pymongo
client = pymongo.MongoClient(host='localhost', port=27017)
2. 选择数据库和集合
已有的数据库和集合会选中,没有的会自动创建
# 选择数据库,没有则创建test数据库
db = client.test
# 选择集合,没有则创建students集合
...
原创
2019-09-10 14:32:59 ·
1066 阅读 ·
1 评论