This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-05
Channels
- # admin-announcements (1)
- # beginners (17)
- # boot (5)
- # cljs-dev (50)
- # cljsrn (20)
- # clojars (8)
- # clojure (108)
- # clojure-belgium (1)
- # clojure-brasil (1)
- # clojure-greece (6)
- # clojure-japan (1)
- # clojure-russia (12)
- # clojure-spec (77)
- # clojurescript (19)
- # core-async (2)
- # cursive (4)
- # datomic (12)
- # dirac (6)
- # funcool (3)
- # hoplon (39)
- # lein-figwheel (14)
- # om (12)
- # onyx (3)
- # other-languages (1)
- # protorepl (14)
- # pure-frame (2)
- # re-frame (39)
- # reagent (1)
- # spirituality-ethics (3)
- # yada (7)
How can I pass collection of referenced subitems inside where query. for example like this
(defn make-decision [subitems]
;; subitems is only 1 ID not collection of ids
true)
(d/q '[:find ?item-name
:where
[?i :item/name ?item-name]
[?i :item/subitems ?s]
[(myns.sth/make-decistion ?s)]] db)
If I understand you correctly, are you looking for something like:
(d/q '[:find ?item-name
:in $ [?i …]
:where
[?i :item/name ?item-name]
[?i :item/subitems ?s]
[(myns.sth/make-decistion ?s)]] db subitems)
ah, I think I understand better now - my post isn't what you're looking for. I shouldn't try to help pre-coffee...
my second impression is that I wouldn't try to do this in a query. All of the data is local to the peer anyway, so I think I'd make the query without the last where clause, and pass the results of the query to make-decision
@bhagany: Thank you. I figured out that what I want is probably undoable in one query, but that’s okay
Quick question because I haven't found any information on it so far: is the tx-report-queue
available for in-memory dbs? I use an in-memory Datomic db for testing but even though my calls to d/transact
succeed, I get no transactions reported from the queue.