数据如下:
{
"id":1234,
"date":"2019-01-07",
"quantity":45
},
{
"id":1235,
"date":"2019-01-08",
"quantity":85
},
{
"id":1236,
"date":"2019-01-09",
"quantity":60
}
我想要的结果是:
{
"id":1234,
"date":"2019-01-07",
"quantity":45
},
{
"id":1235,
"date":"2019-01-08",
"quantity":130
},
{
"id":1236,
"date":"2019-01-09",
"quantity":190
}
此post回答了如何使用map Reduce做到这一点,但我只能使用聚合。有没有办法通过聚合来做到这一点?