Mongodb Atlas: not authorized on admin to execute command

前端 未结 9 1754
小蘑菇
小蘑菇 2021-02-12 17:56

I have a MongoDB Atlas cluster within which I am trying to simply copy a database within the same instance. Unfortunately, every time I try to run db.copyDatabase() or copydb ad

9条回答
  •  粉色の甜心
    2021-02-12 18:42

    I had the same issue when I was trying to connect to a cluster with Node.js version 3.0 or later and using the link below:

    mongodb+srv://username:password@cluster0-eoowo.mongodb.net/test?retryWrites=true

    By selecting version 2.2.12 or later and using the link provided, everything went well

    mongodb://username:password@cluster0-shard-00-00-eoowo.mongodb.net:27017,cluster0-shard-00-01-eoowo.mongodb.net:27017,cluster0-shard-00-02-eoowo.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true

提交回复
热议问题