简体   繁体   中英

Connection with MongoDB Atlas

I am trying to establish a connection between my local project and a MongoDB Atlas DB, but i get this error

MongoServerError: user is not allowed to do action [find] on 

I have set the IP 0.0.0.0/0 in Atlas network access

const connection = mongoose.createConnection('mongodb+srv://<username>:<password>@cluster0.gn78i2u.mongodb.net/?retryWrites=true&w=majority', {
    useNewUrlParser: true,
    useUnifiedTopology: true
})

I have added my username and password aswell but nothing worked, any ideas?

i use string without +srv, like that: ('mongodb://LOGIN:PASS@IP:PORT')

and getting a good connection

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM