This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-19
Channels
- # announcements (5)
- # beginners (68)
- # boot (1)
- # cider (27)
- # clara (11)
- # cljdoc (10)
- # clojure (129)
- # clojure-europe (2)
- # clojure-italy (16)
- # clojure-nl (15)
- # clojure-spec (74)
- # clojure-uk (31)
- # clojurescript (62)
- # core-async (17)
- # cursive (28)
- # datomic (22)
- # duct (29)
- # emacs (10)
- # fulcro (65)
- # hoplon (2)
- # hyperfiddle (16)
- # instaparse (3)
- # kaocha (2)
- # lein-figwheel (3)
- # leiningen (1)
- # mount (1)
- # nrepl (21)
- # off-topic (23)
- # re-frame (59)
- # reitit (18)
- # ring-swagger (2)
- # shadow-cljs (2)
- # spacemacs (16)
- # timbre (2)
- # tools-deps (22)
Could you show the expression that causes this exception? I guess that the parameters are not at the right place in your function call, w.r.t. your query.
This is the query that causes it.
(d/q '[:find ?cust-id
:in $ ?metric
:where
[?metric :metric/integration ?integration]
[?customer :customer/integrations ?integration]
[?customer :entity/id ?cust-id]] db [:entity/id metric-id])
@kenny is it possible that metric-id
is bound to a database value instead? (e.g. swapped function args during a refactor)
I'm pretty sure the above exception is due to a bug in Datomic related to require
not being thread safe.
If I have user-group
s with many users
, and a user
has a boolean attribute like :user/activated
, how can I compose a query to find just user groups where all users have that attribute true? Something like [:find ?group :where [?group :user-group/users ?u] [?u :user/activated true]]
just finds me groups with at least one activated user. I’ve tried using (not ...)
and looked for some kind of all
predicate without any success.
I can get the desired effect with (count-distinct ?activated)
and filtering out groups with counts of 2, but that doesn’t seem like a great solution.
@joshmiller have a look at the missing?
predicate: https://docs.datomic.com/cloud/query/query-data-reference.html#missing
Yeah, it’s set for all, but some are true and some are false.
i’d have to poke at it a bit, but i think you can use a :with
grouping https://docs.datomic.com/cloud/query/query-data-reference.html#with
which will get you the “bag not set” of values that you can then do an aggregation on
I think you could also do it with a not-join
https://docs.datomic.com/cloud/query/query-data-reference.html#not-join
Cool, I’ll take a look at :with
I tried not-join
without any success, via something like: (not-join [?group ?user] [?user :user/activated false])
but that didn’t do it for me
No worries, thanks for the leads