mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
33 lines
647 B
JavaScript
33 lines
647 B
JavaScript
var _id = '';
|
|
var update = {
|
|
$addToSet: {
|
|
'purchased.plan.mysteryItems':{
|
|
$each:['head_mystery_201508','armor_mystery_201508']
|
|
}
|
|
}
|
|
};
|
|
|
|
/*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});
|
|
}
|
|
|