PyMongo 身份验证问题

问题描述 投票:0回答:0

尝试在此处打印集合时出现错误。

import pymongo

MONGODB_URI = "mongodb+srv://myAtlasDBUser:#########@myatlasclusteredu.rgzjvt9.mongodb.net/?retryWrites=true&w=majority"

client = pymongo.MongoClient(MONGODB_URI)

db = client.myAtlasClusterEDU

# Print the name of the current database
print("Current Database:", db.name)

# List all collections in the current database
collections = db.list_collection_names()
print("Collections in the current database:", collections)

错误:文件“C:\User

python connection pymongo
© www.soinside.com 2019 - 2024. All rights reserved.