Database

[{count:1,month:10,year:2022,verified:true},{count:4,month:7,year:2022,verified:true},{count:3,month:2,year:2022,verified:true},{count:1,month:3,year:2022,verified:true},{count:1,month:12,year:2021,verified:true},{count:2,month:1,year:2022,verified:true},{count:1,month:8,year:2022,verified:true}]

Query

db.collection.aggregate([{"$group":{"_id":null,"docs":{"$push":"$$ROOT"}}},{"$project":{docs:{"$reduce":{"input":"$docs","initialValue":{accumulatedCount:0,data:[]},"in":{accumulatedCount:{"$sum":["$$this.count","$$value.accumulatedCount"]},data:{"$concatArrays":["$$value.data",[{"$mergeObjects":["$$this",{accumulatedCount:{"$sum":["$$this.count","$$value.accumulatedCount"]}}]}]]}}}}}},{"$unwind":"$docs.data"},{"$replaceRoot":{"newRoot":"$docs.data"}}])

Result