So, as a result of a database call, I get a vector of maps, which let's say look like this:
[{:make "vw", :model "vanagon", :color "blue", :year 1983}
{:make "vw", :model "vanagon", :color "red", :year 1987}
{:make "vw", :model "eurovan", :color "blue", :year 1995}
{:make "vw", :model "eurovan", :color "green", :year 1997}
{:make "geo", :model "metro", :color "blue", :year 1985}
{:make "geo", :model "metro", :color "yellow", :year 1994}]
How can I get that into a nested map using two of the fields, e.g. like this:
{"vw" {"vanagon" [{:color "blue", :year 1983}, {:color "red", :year 1987}]
"eurovan" [{:color "blue", :year 1995}, {:color "green", :year 1997}]}
"geo" {"metro" [{:color "blue", :year 1985}, {:color "yellow", :year 1994}]}}
I have been messing around with group-by and other coll functions for a couple hours, and I can't wrap my head around it and figure out a reasonable way to do this.
Thanks!