Hi all,
So finally I have managed to get to write some clojure. Gotta say, after
two days I am seriously excited - talk about removing ceremony and focusing
on the issue. I feel like a blind man performing surgery with welding
gloves on whilst holding this tiny but unbelievably powerful and mysterious
tool (compared to a seeing man performing surgery with welding gloves
expertly using the Java welding torch :)). I have *so* much learning to do
around clojure (and choosing appropriate metaphors :)) - I love it!
Anyway, my first (of many) questions:
I have a vector of maps generated as a result of an outer-join. I want to
convert that into a map of maps where the keys in the first map are the
distinct set of some key in vector of maps and the value is a vector of
maps that have that value.
For example, given:
[{:id 1, :name abc} {id:2 :name def} {id:1 :name xef}]
then coolFunctionWhichIsAlludingMe would return
{1 [{:id1 :name abc} {:id1 :name xef}] 2 [{id:2 :name def}]}
The context for this is if I do a "select * from order join
order-line-items" then I get a map from order to order-line-items.
I know this is 101 and I would be astonished if there wasn't a function
already in core to do this. I have read a gazillion resources around
Clojure as well (a while ago) but it is all surface knowledge and doesn't
stick until I actually get down to using the tools, which is happening now.
(I am sort-of apologising for taking up traffic with such a ridiculously
simple question :)).
Thanks!
Col
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en