コードをアトラス mongo db に接続しようとしていますが、以下のエラーが表示されます。これが私のコードです。
from pymongo import MongoClient
client = MongoClient("mongodb+srv://username:test@cluster0.yntdf.mongodb.net/test?
retryWrites=true&w=majority")
db = client["test"]
collection = db["test"]
collection.insert_one({"_id":0, "name": "hello", "score": 5})
エラーが発生しました:
ConfigurationError: DNS ラベルが空です。
このエラーの処理方法を知っている人はいますか? dnspython と pymongo をインストールしました