Database
[{"state":"VALIDATED","phone":"xxx","civilStatus":"SINGLE","gender":"MALE","professionalCategory":"STUDENT"},{"state":"INVALIDATED","phone":"yyy","civilStatus":"MARRIED","gender":"FEMALE","professionalCategory":"PROFESSOR"}]
Query
db.collection.aggregate([{"$facet":{"genders":[{"$group":{"_id":"$gender","total":{$sum:1}}}],"civilStatus":[{"$group":{"_id":"$civilStatus","total":{$sum:1}}}],"professionalCategory":[{"$group":{"_id":"$professionalCategory","total":{$sum:1}}}],"validated":[{"$group":{"_id":"$state","total":{"$sum":1}}}]}},{$set:{validated:{"$filter":{"input":"$validated","cond":{"$eq":["$$this._id","VALIDATED"]}}}}},{$set:{validated:{"$ifNull":[{"$arrayElemAt":["$validated",0]},0]}}},{$set:{validated:"$validated.total"}}])