2013-11-07 20:47:33 +00:00
|
|
|
db.users.find({
|
|
|
|
|
$or: [
|
2018-02-17 17:11:24 +00:00
|
|
|
{'backer.admin': {$exists: 1}},
|
|
|
|
|
{'backer.contributor': {$exists: 1}},
|
|
|
|
|
],
|
|
|
|
|
}, {backer: 1}).forEach(function (user) {
|
2013-11-07 20:47:33 +00:00
|
|
|
user.contributor = {};
|
|
|
|
|
user.contributor.admin = user.backer.admin;
|
|
|
|
|
delete user.backer.admin;
|
|
|
|
|
|
|
|
|
|
// this isnt' the proper storage format, but I'm going to be going through the admin utility manually and setting things properly
|
|
|
|
|
if (user.backer.contributor) {
|
|
|
|
|
user.contributor.text = user.backer.contributor;
|
|
|
|
|
delete user.backer.contributor;
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-17 17:11:24 +00:00
|
|
|
db.users.update({_id: user._id}, {$set: {backer: user.backer, contributor: user.contributor}});
|
2013-11-07 20:47:33 +00:00
|
|
|
});
|