diff --git a/migrations/mystery_items.js b/migrations/mystery_items.js index 000188285d..1feef7de2a 100644 --- a/migrations/mystery_items.js +++ b/migrations/mystery_items.js @@ -24,9 +24,15 @@ var update = { if (_id) { // singular (missing items) - db.users.update({_id:_id}, update); + db.users.update({_id: _id}, update); } else { // multiple (once @ start of event) - db.users.update({'purchased.plan.customerId':{$ne:null}}, update, {multi:true}); + db.users.update({ + 'purchased.plan.customerId': { $ne: null }, + $or: [ + { 'purchased.plan.dateTerminated': { $gte: new Date() } }, + { 'purchased.plan.dateTerminated': { $exists: false } }, + { 'purchased.plan.dateTerminated': { $eq: null } } + ] + }, update, { multi: true }); } -