-
Type:
Task
-
Resolution: Won't Do
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Ticket MONGOID-5270 implements tally with a single field arg.
I'd like to propose that tally support multiple field args (as a splat), then return the result as an Array<Hash>. This would allow us to fetch multiple tallies in a single aggregation pipeline pass, saving on time/db resources.
Dog.tally(:color, :size)
#=> [ { yellow: 9,
# brown: 7,
# white: 14 },
# { small: 10,
# medium: 9,
# large: 11 } ]