Database

db={"Accounts":[{_id:1,name:"xyz"},{_id:2,name:"abc"},{_id:3,name:"def"},{_id:4,name:"pqr"},],"Responses":[{_id:1,accountId:2,questionId:"0001",res:true},{_id:2,accountId:2,questionId:"0002",res:true},{_id:3,accountId:2,questionId:"0003",res:false},{_id:4,accountId:3,questionId:"0002",res:false},{_id:5,accountId:2,questionId:"0003",res:false},]}

Query

db.Accounts.aggregate([{$match:{_id:2}},{$lookup:{from:"Responses",localField:"_id",foreignField:"accountId",as:"responses"}},{$unwind:"$responses"},{$group:{_id:"$_id",name:{$first:"$name"},trueResponses:{$sum:{$cond:[{$eq:["$responses.res",true]},1,0]}},falseResponses:{$sum:{$cond:[{$eq:["$responses.res",false]},1,0]}}}}])

Result