pymongo连接带用户名密码认证的MongoDB
import pymongo conn = pymongo.MongoClient('mongodb://root:pass@localhost:27017/') db = conn['database'] coll = db['collection']
官方链接: https://docs.mongodb.com/manual/reference/connection-string/
路上除了风景还有故事
import pymongo conn = pymongo.MongoClient('mongodb://root:pass@localhost:27017/') db = conn['database'] coll = db['collection']
官方链接: https://docs.mongodb.com/manual/reference/connection-string/