Files
habitica/migrations/mystery_items.js
Sabe Jones d32d05e873 feat(mystery): July 2015 goodies
Also makes the mystery box opening notification translatable and adds item graphics to it.
2015-07-23 12:05:13 -05:00

33 lines
649 B
JavaScript

var _id = '';
var update = {
$addToSet: {
'purchased.plan.mysteryItems':{
$each:['back_mystery_201507','eyewear_mystery_201507']
}
}
};
/*var update = {
$set:{
'purchased.plan':{
customerId: "",
dateCreated: new Date(),
dateTerminated: null,
dateUpdated:new Date(),
gemsBought: 0,
mysteryItems: [],
paymentMethod: "Paypal",
planId : "basic_earned"
}
}
};*/
if (_id) {
// singular (missing items)
db.users.update({_id:_id}, update);
} else {
// multiple (once @ start of event)
db.users.update({'purchased.plan.customerId':{$ne:null}}, update, {multi:true});
}