MongoDB running total like aggregation of previous records up until occurrance of value
问题 I am currently dealing with a set of in-game-events for various matches. In the game it is possible to kill enemies and purchase items in a shop. What I have been trying to do right now, is to count the number of kills that have occured in a single match up until every purchasing event. { "_id" : ObjectId("5988f89ae5873exxxxxxx"), "gameId" : NumberLong(2910126xxx) "participantId" : 3, "type" : "ITEM_PURCHASED", "timestamp" : 656664 }, { "_id" : ObjectId("5988f89ae5873exxxxxxx"), "gameId" :