This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-24
Channels
- # announcements (4)
- # babashka (75)
- # beginners (57)
- # calva (26)
- # cider (1)
- # clj-kondo (18)
- # cljs-dev (2)
- # clojure (31)
- # clojure-czech (1)
- # clojure-europe (23)
- # clojure-france (3)
- # clojure-germany (2)
- # clojure-uk (3)
- # clojurescript (23)
- # conjure (9)
- # data-oriented-programming (5)
- # datomic (14)
- # defnpodcast (1)
- # deps-new (12)
- # expound (4)
- # fulcro (32)
- # helix (4)
- # jackdaw (70)
- # joker (1)
- # malli (1)
- # music (2)
- # off-topic (19)
- # other-languages (6)
- # podcasts-discuss (5)
- # portal (6)
- # quil (5)
- # re-frame (16)
- # shadow-cljs (14)
- # spacemacs (7)
- # vim (5)
- # xtdb (22)
Suppose I have
{:crux.db/id :some-id
:match/teams [:lakers :celtics]}
I want all pairs of teams that have played
{:find [t]
:where [[m :match/teams t]]}
only returns each individual teamI got this working with a pull
{:find [(pull m [:match/teams])]
:where [[m :match/teams]]}
But now, I want a count of all those pairs
The results I want would look something like
#{[[:lakers :celtics] 80] [[:bulls :celtics] 12]....
'{:find [t1 t2 (count m)]
:where [[m :match/teams t1]
[m :match/teams t2]
[(!= t1 t2)]]}
Is there a way to pull a rule out into a var for reuse?
Ah, I quoted wrong.
Are you from Juxt?
Cool, and yes I am indeed - I have been working with Crux since it launched. Please feel free to ask any questions you like and I will do my best to answer :)
That’s cool. I worked with Hakan briefly and I saw a video of him presenting Crux at a conf.
Ah, awesome! Hakan's not active on Slack but he's very much still dedicated to Crux behind the scenes...big plans are afoot 😉
Yes, I figured Hakan’s not active on Slack.