I have a collection 'comments' as follows:
{
comment_id:10001
aspects:[
{
name:'aspectA',
positive:2
negative:3
neutral:1
},
{
name:'aspectB',
positive:1
negative:5
neutral:3
}
},
{
comment_id:10002
aspects:
{
name:'aspectA',
positive:2
negative:1
neutral:2
},
{
name:'aspectB',
positive:3
negative:4
neutral:1
}
}
]
the count of documents in comments is greater than 100K. I have to find the count of positive, negative and neutral for all aspects, ie. the sum of positive, negative and neutral for each aspect from the aspects
field (which is a list of dicts as mentioned above) for all documents. I found that mapreduce can be used to do the task but I couldn't find enough docs to build a query.
Is there a way to find this using one query?