Fork me on GitHub
#datascript
<
2020-09-16
>
Maik Wild08:09:50

Hi. I am trying to query for a boolean value. I have ran into trouble as it seems querying for the value false will always be true. I am using re-posh (cljs) Example:

(re-posh/reg-sub
 ::get-non-admins
 (fn [_ _]
   {:type  :query
    :query '[:find [?entity-id ...]
             :where [?entity-id :user/admin false]]}))
This will return all users. If i replace false with true it will only return the admins. Is there any workaround so I can query for any user with :user/admin == false?

lilactown16:09:29

(datalog newbie here) you could try (not [?entity-id :user/admin true]) ?

Maik Wild05:09:45

(not […]) does not seem to work in posh 😞

Maik Wild05:09:43

Cannot compare :totally/unrelated-node to [$ ?entity-id :user/admin true]