ribelo / doxa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pull with > join to N entities only returns first join results

stevebuik opened this issue · comments

(let [db (dx/create-dx [{:id 1
                         :name "Steve"
                         :languages/spoken [{:id 2
                                             :name "english"}
                                            {:id 3
                                             :name "dutch"}]
                         :languages/computer [{:id 4
                                             :name "clojure"}
                                            {:id 5
                                             :name "typescript"}]}])]
  {:incorrect (dx/pull db [:id {:languages/spoken [:*]} {:languages/computer [:*]}] [:id 1])
   :correct (dx/pull db [:id {:languages/computer [:*]}] [:id 1])})

=>
{:incorrect {:id 1, :languages/spoken [{:id 2, :name "english"} {:id 3, :name "dutch"}]},
 :correct {:id 1, :languages/computer [{:id 4, :name "clojure"} {:id 5, :name "typescript"}]}}

this one is a blocker so please look at this before #25

now that I think about it, I can workaround it by parsing the pull expr and running N pulls (one for each map) and then merging the result.

not ideal, but at least it doesn't block me

fix confirmed in hotplate. thanks!