Fork me on GitHub
#specter
<
2019-10-26
>
Trevor17:10:03

Hi folks, what would be the best way to change this:

[
{:name "a" :args [1 2 3]}
{:name "a" :args [5 6 7]}
{:name "b" :args [1]}
]
into this:
{
:name "a" :arg-list [ [1 2 3] [5 6 7]]
:name "b" :arg-list [[1]]
}
I want to take a vector of maps which have a bunch of duplicate :name values with different vectors of :args and map the :names to a vector of vectors of their args. I'm using Spectre for most of the json transformations, but I'm new to clojure and this transformation is non-obvious to me.