codecombat/scripts/mongodb/migrations/2016-08-31-add-achievements-updated.js

8 lines
267 B
JavaScript
Raw Normal View History

var d = new Date();
db.achievements.find({}, {_id:1}).sort({_id:1}).forEach(function(achievement) {
db.achievements.update({_id: achievement._id}, {$set: {updated: d.toISOString()}})
print('set', achievement._id, 'to', d);
d.setSeconds(d.getSeconds() + 1)
});