If I want to transform the same data in two ways, should I just run two operations? Or can I have a single operation with two "right hand sides"?
Can you give an example?
Sorry for the screenshot. I literally don't know how to copy and paste out of my remote editor.
totally silly contrived example.
@gdwarner Two seems right in this case. The first query is a join and the second is not. In the second you do not need to look for {:id ?team} though.
Depending on the project, it might be a good idea to index the teams by :id first.
(let [data {:people [{:name "greg", :team 1} {:name "jill" :team 2}]
:teams [{:id 1 :name "stars"} {:id 2 :name "fish"} {:id 3 :name "dogs"}]}
teams (:teams data)
people (:people data)
team-idx (into {} (map (juxt :id identity)) teams)]
{:players (m/search [people team-idx]
[(m/scan {:name ?name, :team ?team-id})
{?team-id {:name ?team}}]
{:name ?name :team ?team})
:teams (map :name teams)})