This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-10
Channels
- # admin-announcements (2)
- # arachne (2)
- # beginners (53)
- # boot (52)
- # cider (7)
- # cljs-dev (61)
- # cljsrn (12)
- # clojure (61)
- # clojure-greece (22)
- # clojure-nl (16)
- # clojure-russia (103)
- # clojure-spec (84)
- # clojure-uk (15)
- # clojurescript (137)
- # community-development (14)
- # cursive (4)
- # datomic (14)
- # devcards (6)
- # euroclojure (3)
- # funcool (26)
- # hoplon (27)
- # jobs (4)
- # lambdaisland (1)
- # leiningen (1)
- # om (75)
- # onyx (77)
- # planck (15)
- # proton (2)
- # re-frame (23)
- # ring-swagger (9)
- # schema (1)
- # specter (95)
- # untangled (124)
- # yada (27)
Does anybody else run Datomic on FreeBSD? About to upgrade from openjdk7->openjdk8 and was curious if there are any known problems.
(d/q '[:find [?e ...]
:in $ ?host-id [?ignore-keys ...]
:where
[?e :host/belongs-to ?host-id]
[(!= ?e ?ignore-keys)]]
(d/db (user/get-connection))
:company/name
(:db/id (user/get-tenant))
[17592186104562 17592186081714 17592186098554])
Does anyone know why [(!= ?e ?ignore-keys)]
does not work? it works when I change !=
to =
Or is the problem that I try to filter by id's
I see the same result. If I pass in ?ignore-keys
whole (`:in $ ?host-id ?ignore-keys`) and look for ?e
missing from ?ignore-keys
via homegrown predicate (`(defn nadda [e vs] (-> vs set (get e) not))`), I get the expected behavior, using [(#'datomic.fun/nadda ?e ?ignore-keys)]
.
I'm not sure why it doesn't work, but in this case I'd just leave that where clause out, and filter the result of the query. The data's all local.
I'm all about encouraging people to remember the data is local, because I'm using the rest api, and I'm constantly wishing it were true for me.
Negation in Datalog is tricky.
[(!= ?e ?ignore-keys)]
will be evaluated as a predicate.
That means, for all bindings of ?e
and ?ignore-keys
established so far in the query, it will evaluate the expression (!= ?e ?ignore-keys)
and remove any bindings for which that expression returns false.
The bindings include every possible combination of ?e
and ?ignore-keys
, so the !=
predicate will return true at least once for every ?e
.
is it possible to parameterize the pull query like so?
(d/q ‘[:find (pull ?e ?query) :in $ ?query :where [?e …]] db query)