Do "not have permission to rename collections across dbs" as admin

Hi everyone.

I’m getting a permission error when trying to rename a collection from one DB to another DB in Mongosh. I know I can clone a collection but it is many GBs. This rename method seemed quicker as apparently just changes the metadata.

MongoServerError: do not have permission to rename collections across dbs

Note when connecting I specify admin:

mongosh "mongodb+srv://<credentials>@serverlessinstance.snadh.mongodb.net/?authSource=admin

My user credentials:
image

Below is the code I run.

Atlas test> use admin
switched to db admin
Atlas admin> db.runCommand({renameCollection: "tigerspidertest.TESTING", to: "tigerspider.TEST"})
MongoServerError: do not have permission to rename collections across dbs
1 Like