I have the below mongo collection structure
{
"_id":"some mongo Id",
"email":"[email protected]",
"Course1":[
{
"sublesson":1,
"timespent":10,
"timestamp":"123456"
},
{
"sublesson":1,
"timespent":20,
"timestamp":"123457"
},
{
"sublesson":2,
"timespent":20,
"timestamp":"123458"
}
]
}
Now, all need is to find the sum of time taken for each sublesson aggregated. I have tried some methods but cannot access the data inside the "course1" array.