Fork me on GitHub
#xtdb
<
2022-03-03
>
Ivan Fedorov19:03:44

Can I pull a denormalised structure from normalised data? If I put this in

(def village
  {:xt/id         "Lviv"
   :location/name "Lviv"
   :location/children ["Son1" "Son2"]})

(def village-son1
  {:xt/id         "Son1"
   :location/name "Son1"})

(def village-son2
  {:xt/id         "Son2"
   :location/name "Son2"})
Can I pull out?
{:xt/id         "Lviv"
 :location/name "Lviv"
 :location/children 
  [{:xt/id         "Son1"
   :location/name "Son1"}
   {:xt/id         "Son2"
    :location/name "Son2"}]}

refset20:03:39

Yep, joins like that will work great! See the pull aggregate, or API, in the docs. XT's pull implements the EQL spec

Ivan Fedorov08:03:58

thank you!!

🙏 1