rubberguppe/migrations/lowerCaseIds.js
2019-09-25 23:08:55 -04:00

12 lines
373 B
JavaScript

db.objects.find({type: "Group"}).forEach(function(d){
d.id = d.id.toLowerCase();
db.objects.save(d);
});
db.streams.find({"_meta._target": {$ne: null}}).forEach(function(d){
d._meta._target = d._meta._target.toLowerCase();
db.objects.save(d);
});
db.streams.find({actor: /gup\.pe/}).forEach(function(d){
d.actor = d.actor.toLowerCase();
db.streams.save(d);
});