[英]Connection with MongoDB Atlas
我正在嘗試在本地項目和 MongoDB Atlas DB 之間建立連接,但出現此錯誤
MongoServerError: user is not allowed to do action [find] on
我在 Atlas 網絡訪問中設置了 IP 0.0.0.0/0
const connection = mongoose.createConnection('mongodb+srv://<username>:<password>@cluster0.gn78i2u.mongodb.net/?retryWrites=true&w=majority', {
useNewUrlParser: true,
useUnifiedTopology: true
})
我也添加了我的用戶名和密碼,但沒有任何效果,有什么想法嗎?
我使用不帶 +srv 的字符串,就像這樣: ('mongodb://LOGIN:PASS@IP:PORT')
並獲得良好的連接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.