rubberguppe/migrations/profileImageFormat.js
2019-09-29 11:59:02 -05:00

11 lines
214 B
JavaScript

db.objects.find({type: "Group"}).forEach(function(d) {
if(typeof d.icon !== 'string') {
return;
}
d.icon = {
type: 'Image',
mediaType: 'image/jpeg',
url: d.icon
};
db.objects.save(d);
});