I have collection that contains documents with below schema. I want to filter/find all documents that contain the gender female and aggregate the sum of brainscore. I tried the
Sample working query :
db.getCollection('NOTIF_EVENT_RESULT').aggregate([ {$match: {'userId': {'$in' : ['user-900', 'user-1546']}, 'criteria.operator': 'greater than', 'criteria.thresold' : '90', 'category' : 'capacity'} }, {"$group" : {_id : {userId:"$userId"}, "count" : { "$sum" : 1} } } ])