Database
[{id:100,status:"ordered",country:"US",items:[]},{id:101,status:"ordered",country:"UK",items:[]},{id:102,status:"shipped",country:"UK",items:[]},]
Query
db.collection.aggregate([{$group:{_id:"$country","shipped":{$sum:{$cond:[{$eq:["$status","ordered"]},0,1]}},"ordered":{$sum:{$cond:[{$eq:["$status","shipped"]},0,1]}}}},{$project:{_id:1,status:{shipped:"$shipped",ordered:"$ordered"}}}])