How to rename a user in MongoDB? -
there user in database, user should renamed. how rename user? mongodb user management reference has method db.updateuser don't see how set new name user. how update username? ty
db.updateuser( "<username>", { customdata : { <any information> }, roles : [ { role: "<role>", db: "<database>" } | "<role>", ... ], pwd: "<cleartext password>" }, writeconcern: { <write concern> } )
did try update user?
db.system.users.update({"user":"oldname"}, {$set:{"user":"newname"}})
this command requires root
access admin database.
Comments
Post a Comment