codecombat/scripts/mongodb/migrations/2016-08-31-add-achievements-updated.js
Scott Erickson 2fe28852b4 More achievement tweaks
* Clients check updated achievements as well as new ones
* Clients do not wait to keep checking
* Update achievement points along with everything else in EarnedAchievement.upsertFor
* Fix various bugs
2016-09-06 09:37:02 -07:00

7 lines
267 B
JavaScript

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)
});