MongoDB
 sql >> Base de Dados >  >> NoSQL >> MongoDB

como corrigir:'MongoError:falha de autenticação' @MongoDB Atlas


Você tem que colocar seu user e password na sua string uri de conexão
 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

por exemplo
 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