mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
Added check for existence of dateTerminated field
This commit is contained in:
parent
b75f044d07
commit
be3fe8f1f4
1 changed files with 6 additions and 3 deletions
|
|
@ -27,6 +27,9 @@ if (_id) {
|
|||
db.users.update({_id:_id}, update);
|
||||
} else {
|
||||
// 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});
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue