I'd like to do something like this:
r.db('research').table('books').group('year').sum('size_bytes').count().run()
And get a result like this:
{
{"group": 1901,
"reduction_size_bytes": 13929238,
"reduction_count": 192},
{"group": 1902,
"reduction_size_bytes": 21194721,
"reduction_count": 223},
...
}
Currently, I only know how to get one "reduction" at a time, e.g. sum of size_bytes:
r.db('research').table('books').group('year').sum('size_bytes').run()
Result:
{
{"group": 1901,
"reduction": 13929238},
{"group": 1902,
"reduction": 21194721},
...
}