Created
January 22, 2014 15:55
-
-
Save slagyr/8561271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn not-set | |
"Returns true if attr is not set for e" | |
[db e attr] | |
(let [result (api/q '[:find ?v | |
:in $ ?e ?a | |
:where [?e ?a ?v]] | |
db e attr)] | |
(-> result first empty?))) | |
(defn pets-without-tails [owner-id] | |
(api/q '[:find ?e | |
:in $ ?owner-id | |
:where | |
[?e :pet/owner ?owner-id] | |
[(my-ns/not-set $ ?e :pet/tail)]] | |
(db/db) owner-id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment