I have a mongodb collection full of documents like this :
{
_id : xxxxxx
category : 1,
tech : [
{key:"size",value:5},
{key:"color",value:"red"}
{key:"weight",value:27.4}
]
}
My question is : how can I do to aggregate (average, sum or whatever) each item with key = "size" in this collection?
thank you for your help