How to do the aggregation count on the group by with C#

Hello Everyone,

My requirement is to do aggregation count on columns when do GroupBy JobID.
I want to aggregation count on the columns - Sent, Delivered, Read and Failed and also want to check those columns has existed or not.
If Sent and Delivered columns has existed and it has value, I need to count on them.
At my collection, there are two records that Sent and Delivered column has existed and has value.
Other Read and Failed are not existed totally.
So the output will be “SentCount” : “2”,
“DeliveredCount” :“2”,
“ReadCount” : 0,
“FailedCount” : 0

Please help me the way to write the query in C# and I am new to mongodb.

Thank you so much in advance.

My collection is the below.

[{

	"JobID": "Jobid1",
	"TemplateName": "templateName",
	"CampaignName": "campaignName",
	"Channel": "channel",
	"SentBy": "sentBy",
	"SentFrom": "sentFrom",
	"Sent": "2022-08-01",
	"Delivered": "2022-08-01"

}, {

	"JobID": "Jobid1",
	"TemplateName": "templateName",
	"CampaignName": "campaignName",
	"Channel": "channel",
	"SentBy": "sentBy",
	"SentFrom": "sentFrom",
	"Sent": "2022-08-01",
	"Delivered": "2022-08-01"

}, {

	"JobID": "Jobid1",
	"TemplateName": "templateName",
	"CampaignName": "campaignName",
	"Channel": "channel",
	"SentBy": "sentBy",
	"SentFrom": "sentFrom"

}]

I want to output like the below

{

"JobID" : "Jobid1",
"TemplateName" : "templateName",
"CampaignName" : "campaignName",
"Channel" : "channel",
"SentBy" : "sentBy",
"SentFrom" : "sentFrom",
"SentCount" : "2",
"DeliveredCount" :"2",
"ReadCount" : 0,
"FailedCount" : 0

}