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
}
}