From b75f044d07bc9cefe9d62b859209db1887b1173b Mon Sep 17 00:00:00 2001 From: kylestratis Date: Sun, 25 Oct 2015 18:16:42 -0400 Subject: [PATCH] Changed Mongo query to check DateTerminated to prevent accumulation of mystery items when subscription is ended. --- migrations/mystery_items.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/mystery_items.js b/migrations/mystery_items.js index 48f2009b15..9a7b37eec4 100644 --- a/migrations/mystery_items.js +++ b/migrations/mystery_items.js @@ -27,6 +27,6 @@ if (_id) { 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({$and: [{'purchased.plan.customerId':{$ne:null}},{$or: [{'purchased.plan.dateTerminated':{$gte:new Date()}},{'purchased.plan.dateTerminated':{$eq:null}}]}]}, update, {multi:true}); }