For example I have the following data in MongoDB:
{
"student": "Pedro",
"class_id": 10,
"scores": [
{
"type":"exam",
"score": 10
},
{
"type":"homework",
"score": 10
}
]
}
Now I want to query "SUM the scores - score", how could I do this using Mongo Shell?