Skip to content

Commit

Permalink
filtering lab member on HCERES period fixes #387
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgirard committed Mar 15, 2017
1 parent 304af33 commit c6b7f79
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion server/export/annex4.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,21 @@ module.exports = function annex4(models, centerId, callback) {
return People.aggregate([
{
$match: {
'academicMemberships.organization': ObjectId(centerId)
academicMemberships: {
$elemMatch:{
$and:[
{organization: ObjectId(centerId)},
{$or: [
{endDate:{$gte: HCERESPERIOD.startDate}},
{endDate:{$exists: false }}
]},
{$or: [
{startDate:{$lte: HCERESPERIOD.endDate}},
{startDate:{$exists: false }}
]}
]
}
}
}
},
{
Expand Down

0 comments on commit c6b7f79

Please sign in to comment.