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
I had faced a similar obstacle and spent hours, the problem was with the connection string provided by mongodb atlas which is: mongodb+srv://username:password@clusterName-jynkd.mongodb.net/test?retryWrites=true
I used a different connection string and worked perfectly. This is it:
mongodb://username:password@clusterName+port/yourdb?retryWrites=true&ssl=true&authSource=admin
.
Make sure the clustername + port are like this:
clusterName-shard-00-00-jynkd.mongodb.net:27017