I have a model(User), which has two ref objects(Training, Evaluation), each ref object holds some content with results on different dates.
When I populate, I want to filter data of "Training" & "Evaluation" results at specific dates.
I am trying something like this, please help
Mnguser.find({})
.populate({
path: 'Training Evaluation',
match: {
'Training.trainDate':{
$gt: firstDay,
$lt: lastDay
},
'Evaluation.evalDate':{
$gt: firstDay,
$lt: lastDay
}
}
})
.then(res){results}
Note: Training & Evaluation are an array of objects, above is just a view of my thought.
Thanks in advance