Count items from another document in mongodb aggregation
问题 I have two distinct documents as Accounts [ {_id:1, name:'xyz'}, {_id:2, name:'abc'}, {_id:3, name:'def'}, {_id:4, name:'pqr'}, ] and Responses [ {_id:01, accountId:2, questionId: 0001, res: true}, {_id:02, accountId:2, questionId: 0002, res: true}, {_id:03, accountId:1, questionId: 0003, res: false}, {_id:03, accountId:3, questionId: 0002, res: false}, {_id:03, accountId:2, questionId: 0003, res: false}, ] How can I count number of true and false responses for an individual account while