This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-23
Channels
- # announcements (2)
- # atom-editor (3)
- # babashka (49)
- # beginners (100)
- # biff (9)
- # calva (78)
- # clj-kondo (18)
- # clojure (143)
- # clojure-europe (13)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (58)
- # conjure (1)
- # cursive (4)
- # datascript (11)
- # datomic (63)
- # docker (7)
- # emacs (18)
- # events (1)
- # fulcro (18)
- # graalvm (5)
- # helix (4)
- # improve-getting-started (13)
- # jobs (4)
- # jobs-discuss (3)
- # lsp (15)
- # malli (90)
- # membrane (14)
- # off-topic (12)
- # other-languages (5)
- # pedestal (7)
- # polylith (53)
- # re-frame (15)
- # reitit (23)
- # releases (4)
- # remote-jobs (9)
- # ring (11)
- # shadow-cljs (90)
- # specter (2)
- # testing (3)
- # tools-build (63)
- # vim (2)
- # xtdb (8)
hi, could someone please explain why the following predicate expression isn't filtering out the keyword mentioned:
core=> (cljs.pprint/pprint (d/q `[:find [?k ...] :where [?e :root/user ?r][?r ?k ?v][('not= ?k :user/feature-flags)]] @connection))
[:user/id
:user/disable-global-role?
:user/has-to-accept-license?
:user/first-name
:user/last-name
:user/feature-flags
:user/role
:user/company-id
:user/avatar-url
:user/app-roles
:user/email]
nil
I in fact get the same result if i toggle the not=
to =
(which violates boolean algebra). this indicates to me that the predicate isn't even running (and a println
inside the predicate also confirms that [with a custom, user-defined predicate and the attending :in clause to bring it in]).
this is the result with =
:
core=> (cljs.pprint/pprint (d/q `[:find [?k ...] :where [?e :root/user ?r][?r ?k ?v][('= ?k :user/feature-flags)]] @connection))
[:user/id
:user/disable-global-role?
:user/has-to-accept-license?
:user/first-name
:user/last-name
:user/feature-flags
:user/role
:user/company-id
:user/avatar-url
:user/app-roles
:user/email]
nil
You're already inside an outer [:find ...]
quote there, so this would not produce the desired result
user=> `[:find 'not]
[:find (quote clojure.core/not)]
Sure thing