Unable to get count of exercises in back end project "Apis and Microservices Projects - Exercise Tracker"

I have the following JSON object being returned by mongodb. I am unsure as to how to count all keys matching description(key) to get amount of exercises issued to user. Here is my JSON code. My attempt is to count how many description keys there are in data to get exercises count.

{
"data": {
"_id": "eQrW_nWob",
"username": "Timmy",
"data": [
{
"description": "walking",
"duration": 1,
"date": "2018-11-22T00:00:00.000Z"
},
{
"description": "walking",
"duration": 1,
"date": "2019-01-07T00:00:00.000Z"
}
],
"__v": 0
}
}

It looks like you have your exercises/activities in an array called ‘data’, so as long as you can access that property, why not use data.length? Or, did I misunderstand the question?

Thanks your suggestion helped. My project is now correctly keeping track of count of exercises. :grinning:

Glad to hear it. Good luck!