Added check for existence of dateTerminated field

This commit is contained in:
kylestratis
2015-10-31 22:08:16 -04:00
parent b75f044d07
commit be3fe8f1f4

View File

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