Mongo Playground

Configuration

[{"status":"ONBOARD","count":1},{"status":"PENDING","count":1},]

Query

db.collection.aggregate([{$group:{_id:"$status",count:{$sum:1}}},{$project:{_id:0,status:"$_id",count:1}}])

Result