I have example data
…
{“provider”: 1, “value”: 1, “created_time”: “2014-02-11 04:33:45”}
{“provider”: 1, “value”: 2, “created_time”: “2014-02-12 04:33:45”}
{“provider”: 2, “value”: 3, “created_time”: “2014-02-13 04:33:45”}
{“provider”: 2, “value”: 2, “created_time”: “2014-02-14 04:33:45”}
…
How to write map reduce, query data with a specific range created_time from 2014-02-11 to 2014-02-14 and the group by provider and sum value, results like this:
- provider: 1 value: 3
- provider: 2 value: 5
{“rows”:[
{“key”:[1],“value”:3},
{“key”:[2],“value”:5}
]}
Can someone please help.