Merge branch 'issue-6043' of https://github.com/kylestratis/habitrpg into kylestratis-issue-6043 and remove redundant $and specifier

Conflicts:
	migrations/mystery_items.js
This commit is contained in:
Alys 2015-11-28 19:07:37 +10:00
commit 7bf5300369

View file

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