I have a Mojo::Collection of hashes and I'd like to reduce the collection
similar to an SQL GROUP BY.

Mojo::Collection->new({name=>"name1", total=>2}, {name=>"name1",total=>3},
{name=>"name2", total=>7})


This collection has three elements and the collection I'm looking for would
have two:

{name=>"name1", total=>*5*}, {name=>"name2",total=>7}


I'm trying to group by name and then sum the totals within that group.

It seems like I should use the reduce method of Mojo::Collection; if that's
appropriate, how could I accomplish that?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to