We do copies from Prod -> Dev weekly. For the devs, we need a user that exists on the dev DB side to read/write into the dev DBs but not have this user exist on the prod side so we never have to give devs access to the prod databases whenever we want to give devs access to dev dbs. We do just make a brand new user each time as part of the workflow for this but it seems like there may be better solutions.
To simplify, how can we create a user in mongoDB so that it persists despite any restores or copies we do from Prod databases?
I have been looking into the $external
for MongoDB but I don't think we have something like that setup and if we did how would that factor in RBAC? From what I've read, the external DB is not really a DB at all and only stores credentials. Wouldn't the roles for that user also then be erased if, like I mentioned before, we do a copy down from Prod? I feel like I am wrong here though so please feel free to correct me.