Database
[{"_id":ObjectId("63a2a7d5f974fb6fbf945b7c"),"enquiryId":"e4f22813-66f9-4a09-9e92-66bacd791943","mobile":"7945536728","financierId":"280005","channelId":1000001,"offerAvailable":"YES","offerCheckedDate":ISODate("2021-12-31T19:30:00.000Z"),"financierName":"Cholamandalam Finance","bankOfferAmount":"10000","appliedFinancierId":"280005","appliedFinancierName":"Cholamandalam Finance","paAppliedDate":ISODate("2021-12-31T19:30:00.000Z"),"paDisbursedDate":ISODate("2021-12-31T19:30:00.000Z"),"paSanctionedDate":ISODate("2021-12-31T19:30:00.000Z"),"customAppliedDate":ISODate("2021-12-31T19:30:00.000Z"),"customSanctionedDate":ISODate("2021-12-31T19:30:00.000Z"),"landedOnPAOfferPage":"NO","_class":"com.maruti.fmp.reporting.domain.document.PAOfferDocument"}]
Query
db.collection.aggregate([{$match:{offerCheckedDate:{$gte:ISODate("2021-12-31T00:00:00.000Z"),$lt:ISODate("2021-12-31T23:00:00.000Z")},offerAvailable:"YES",channelId:{$in:[1000001,1000000]},}},{$match:{$expr:{$eq:["$financierId","$appliedFinancierId"]}}},{$group:{_id:"$financierId",mobiles:{$addToSet:"$mobile"},}},{$project:{mobileCount:{$size:"$mobiles"}}}])