Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created November 20, 2010 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwmitchell/708130 to your computer and use it in GitHub Desktop.
Save mwmitchell/708130 to your computer and use it in GitHub Desktop.
(def r [{:id 1, :f "a"} {:id 1, :f "b"} {:id 2, :f "a"}])
; how to transform into:
[{:id 1 :f ["a" "b"]}, {:id 2 :f ["a"]}]
; reduce?
; note: the items inside of r will potential have lots of keys, but i only want to "collapse" the :f key into an array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment