mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Added check for existence of dateTerminated field
This commit is contained in:
@@ -27,6 +27,9 @@ if (_id) {
|
|||||||
db.users.update({_id:_id}, update);
|
db.users.update({_id:_id}, update);
|
||||||
} else {
|
} else {
|
||||||
// multiple (once @ start of event)
|
// multiple (once @ start of event)
|
||||||
db.users.update({$and: [{'purchased.plan.customerId':{$ne:null}},{$or: [{'purchased.plan.dateTerminated':{$gte:new Date()}},{'purchased.plan.dateTerminated':{$eq:null}}]}]}, update, {multi:true});
|
db.users.update([{$and: [{'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});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user