Fork me on GitHub
#xtdb
<
2019-10-09
>
danbunea07:10:18

Hi, here’s a beginner question: How do I join and get the data for the offer and the paintings? Obviously datalog queries are very strange to me. Thanks!

refset07:10:41

I'm pretty sure that everyone finds them very strange initially 😀 Can you manually craft a sample of exactly what you want the results to look like?

danbunea07:10:27

#{[:offer/twenty “20% off” :painting/imagine “Imagine”] [:offer/twenty “20% off” :painting/flipando “Flipando”]}

danbunea07:10:59

offer/twenty has two paintings: painting.flipando and painting/imagine

danbunea08:10:29

I’d like to get a few properties from offers and a few from the paintings

danbunea08:10:45

and maybe I could join in crux.db/id?

refset12:10:46

@U0GE6JTKK hey again, having looked at this in detail now I think you may simply have a typo in (def painting-imagine...shouldn't :painting/name be "Imagine"?

danbunea12:10:35

@U899JBRPF hmmm definately … sorry for wasting your time! and thanks for telling me about the console also.

refset12:10:04

🙂 not a problem, I know very well how easy these mistakes are to make!