I'm trying to group a set of documents and count them based on their value:
{ item: "abc1", value: 1 }
{ item: "abc1", value: 1 }
{ item: "abc1", value: 11 }
{ item: "xyz1", value: 2 }
I would like to group by item
and get in return a count of how many times the value
is bigger than 10
and how many times smaller:
{ item: "abc1", countSmaller: 2, countBigger: 1 }
{ item: "xyz1", countSmaller: 1, countBigger: 0 }