Fork me on GitHub

I’m attempted to do something like a “left” join, but there’s definitely a couple of issues with my attempt, as you can see. What’s the right way to think of this?


If I’m understanding correctly, this maybe pattern helps in the case of a nil, but not when a key is not present in the map. Also, I’m struggling with m/scan or if what I really want is m/cata. Any intuition on when to use those?


It looks like this is what I’m looking for:

(m/rewrite data
    {:name ?name
     :categories [{:category-name !cat-name
                   :id !cat-id} ...]
     :sub-categories ?subs}

    {:name ?name
     :categories [{:name !cat-name
                   :sub-categories (m/app get ?subs !cat-id)}