2019-10-08 14:57:10 +00:00
|
|
|
const oldId = '';
|
|
|
|
|
const newId = '';
|
|
|
|
|
const newUser = db.users.findOne({ _id: newId });
|
2013-06-14 19:56:27 +00:00
|
|
|
|
2019-10-08 14:57:10 +00:00
|
|
|
db.users.update({ _id: oldId }, { $set: { auth: newUser.auth } });
|
2013-06-14 19:56:27 +00:00
|
|
|
|
2019-10-08 16:36:55 +00:00
|
|
|
// remove the auth on the new user (which is a template account).
|
|
|
|
|
// The account will be preened automatically later,
|
2013-06-14 19:56:27 +00:00
|
|
|
// this allows us to keep the account around a few days in case there was a mistake
|
2019-10-08 14:57:10 +00:00
|
|
|
db.users.update({ _id: newId }, { $unset: { auth: 1 } });
|