well below is my implementation
db.services_performed.aggregate([{$match:{status:{$in:
["INVOICING","outbound","accepted","PENDING APPROVAL"]}}},{$group:{_id:{date:{$dateToString:
{format:"%Y-%m-%d",date:"$created_on"}}},invoicing:{$sum:{$cond:[{$eq:
["$status","INVOICING"]},1,0]}},outnound:{$sum:{$cond:[{$eq:
["$status","outbound"]},1,0]}},accepted:{$sum:{$cond:[{$eq:
["$status","PENDING APPROVAL"]},1,0]}}}}])
how can i convert my query into reactive springboot code please help out with
Create agregation query using mongo aggregation api:
Define your result class:
Then autowire
ReactiveMongoTemplatewhich is used to perform queries:And then you method to call mongo template with desired aggregation:
at least it will give you an idea how to achieve what you want