I have a classRoom Object, which stores under desks fields multiple desk objects. This desk object, part of desks array mentioned above, has the the following structure:
desk[0] =
{ value: {
.... other fields,
students: Array of `student` object
}
}
I want to mention that students: array {_id: string (not ObjectId), name: string}
I want to achieve the following:
Return just those classRooms that has a total of students that is LESS than 5.
Do you have any suggestions for that ?
Thank you very much !