In MongoDB, there are many options available but the most basic one is to embed the attendance data into each student document.
db.student.find( { login : "sean" } )
{
login : "sean",
first : "Sean",
last : "Hodges",
attendance : [
{ class : "Maths", when : Date("2011-09-19T04:00:10.112Z") },
{ class : "Science", when : Date("2011-09-20T14:36:06.958Z") }
]
}
Using the above code it will be easier for you to retrieve the attendance data for each and every student.
For more information regarding the same, visit this MongoDB training
Also, have a look at this professional Full Stack Development Course, designed to enhance your skills in the field.