MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

come risolvere:"MongoError:autenticazione non riuscita" @MongoDB Atlas

Devi inserire il tuo user e password nella stringa uri di connessione

 mongodb://***'your user':' here comes password '***@mongo-cluster-shard-00-00-ixqtu.mongodb.net:27017,mongo-cluster-shard-00-01-ixqtu.mongodb.net:27017,mongo-cluster-shard-00-02-ixqtu.mongodb.net:27017/test?ssl=true&replicaSet=mongo-cluster-shard-0&authSource=admin&retryWrites=true

ad esempio

 mongodb://dbuser:[email protected]:27017,mongo-cluster-shard-00-01-ixqtu.mongodb.net:27017,mongo-cluster-shard-00-02-ixqtu.mongodb.net:27017/test?ssl=true&replicaSet=mongo-cluster-shard-0&authSource=admin&retryWrites=true