nasrulhazim
7/24/2017 - 9:25 AM

Rocket.Chat: Reset User Details

Rocket.Chat: Reset User Details

Connect to MongoDB

sudo /snap/rocketchat-server/current/bin/mongo

Select Rocket.Chat Database

use parties

Display all usesrs

db.getCollection('users').find({})

Get User's ID

db.getCollection('users').find({username:'admin'})

Grab the _id to be use in next step.

Update Selected User's Password to 12345

db.getCollection('users').update({_id:"admin"}, { $set: {"services" : { "password" : {"bcrypt" : "$2a$10$n9CM8OgInDlwpvjLKLPML.eizXIzLlRtgCh3GRLafOdR9ldAUh/KG" } } } })

Now you should be ready with new password.

Update User's Role to Admin

You may want to update user's role to admin. Do the following:

db.users.update({username:'admin'}, {$set: {'roles' : [ "admin" ]}})