Fork me on GitHub
#beginners
<
2023-08-05
>
Abhi K21:08:54

Hi Clojurians, Given a sequence of maps as:

({
        :filterName extension_studies,
        :filterValues [No Yes],
        :type StaticFilter
} {
        :filterName stage_oncology,
        :filterValues [Not Available Stage 0 Stage 1 Stage 2 Stage 3 Stage 4],
        :type StaticFilter
})
What's the correct way to convert it into below format:
[{
        "Extension Studies": [
                "No",
                "Yes"
            ]
        },
        {
        "Stage Oncology": [
                "Not Available",
                "Stage 0",
                "Stage 1",
                "Stage 2",
                "Stage 3",
                "Stage 4"
            ]
}]

pppaul21:08:03

can you make the function to transform a single obj to the format you want?

pppaul21:08:20

if you have that function, then you can do (->> my-coll (map my-tr-fn))