1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-13 06:08:54 +09:00
MisskeyIO/tools/migration/user-profile.js
2017-02-22 12:43:15 +09:00

19 lines
318 B
JavaScript

db.users.find({}).forEach(function(user) {
print(user._id);
db.users.update({ _id: user._id }, {
$rename: {
bio: 'description'
},
$unset: {
location: '',
birthday: ''
},
$set: {
profile: {
location: user.location || null,
birthday: user.birthday || null
}
}
}, false, false);
});