This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-22
Channels
- # adventofcode (12)
- # announcements (17)
- # babashka (46)
- # beginners (105)
- # calva (7)
- # chlorine-clover (7)
- # cider (9)
- # clj-kondo (41)
- # cljsrn (16)
- # clojure (67)
- # clojure-australia (1)
- # clojure-europe (24)
- # clojure-france (6)
- # clojure-germany (10)
- # clojure-italy (1)
- # clojure-losangeles (3)
- # clojure-nl (4)
- # clojure-uk (11)
- # clojurescript (8)
- # cursive (8)
- # data-oriented-programming (1)
- # data-science (1)
- # datomic (11)
- # defnpodcast (4)
- # events (1)
- # fulcro (34)
- # graalvm (6)
- # helix (3)
- # jackdaw (19)
- # jobs-discuss (1)
- # leiningen (9)
- # luminus (2)
- # malli (15)
- # mathematics (2)
- # meander (5)
- # mental-health (1)
- # off-topic (4)
- # pathom (23)
- # podcasts-discuss (1)
- # polylith (4)
- # quil (3)
- # re-frame (81)
- # react (1)
- # reagent (19)
- # reitit (4)
- # releases (1)
- # reveal (11)
- # shadow-cljs (54)
- # specter (14)
- # tools-deps (16)
- # vscode (2)
- # xtdb (3)
Querying “entity with greatest some-attr and pulling from that”, I’ve been using not-join
to query that there isn’t another entity with a greater value and was wondering if there is a more convenient pattern I’m missing?
{:find [(max ?some-attr) (pull ?e [*])] …}
perhaps, or am I now missing something
I only care about the ?e
with the max value and want to pull from that, so result should have single row
I just figured, that instead of not-join I can bind the (max ?some-attr)
to value and find the ?e
based on (as the values in my case are unique) EDIT: scratch that, gives different result
split it into two queries: first find the single max value for attr, then query the entity based on that max value… that was faster than not-join
Hey @U11SJ6Q0K , can you create a minimal repro of the data , schema, and the desired result using dev-local ? I’m interested in documenting optimal solutions to this but I think it will depend on quantity, use of tuples, insert/update patterns, etc :)
not sure if I have enough cases for a general case. Looks to me that it’s just about how complex the query to get the “max of some attr” is and how then can you get the :db/id of the entity that had the max value
a max-with-id
aggregate that returns the max value and the :db/id
of the entity that had it, feels like would be useful
Is this all that you’re doing with the query? could you use index-pull or index-range and just grab the first element? Could you write a query function to do that for you from within the query ( if you need to pass that value to other where clauses, for example) Use Reverse flag for max (I think, on mobile).
Hey team, noob question, I wanted to make sure I understood. For the starter plan, What does 1 year of updates / maintenance mean? i.e what will happen after 1 year? Would I simply get another starter license, and upgrade, or something else? Looking at this description, it seems like the difference between starter and pro is support + updates. I wanted to make sure I fully understood that this is the only difference (i.e I can have multiple boxes of datomic running, etc)