For instance, if I have this user:
> db.system.users.find() { \"user\" : \"testAdmin\", \"pwd\" : \"[some hash]\", \"roles\" : [ \"clusterAdmin\" ], \"otherDB
If you want to just update Role of User. You can do in the following way
db.updateUser( "userName", { roles : [ { role : "dbAdmin", db : "dbName" }, { role : "readWrite", db : "dbName" } ] } )
Note:- This will override only roles for that user.