Fork me on GitHub
#meander
<
2023-02-15
>
nyor.tr23:02:36

Hi, I just started learning about meander and I have a couple of questions: Using the data bellow, 1. Would it be possible to join the items in a vector of maps which have the same keys? for example for :authors. (Assuming there will only be two items in the vector :editions). 1. Assign values to keys based on conditions from other keys, for example the key :first-edition-year would have the value of :publication-year if the value of key :first-edition is true. I have:

{:editions [{:book {:id 1
                    :title "title1"
                    :authors ["author1" "author2"]
                    :pages 123
                    :isbn "2353-2343"
                    :publication-year 1995
                    :first-edition true}}
            {:book {:id 2
                    :title "title1"
                    :authors ["author3"]
                    :pages 123
                    :isbn "6745-4623"
                    :publication-year 2001}}]}
Transform into:
{:title "title1"
 :authors ["author1" "author2" "author3"]
 :pages 123
 :first-edition-year 1995
 :publication-year 2001}