Created
January 18, 2016 16:00
-
-
Save Jannis/8fd22f556b55f02589bf 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 popular? [friends] | |
(> (count friends) 2)) | |
(d/q '[:find (boot.user/popular? ?f) . | |
:in $ ?u | |
:where [?u :user/friends ?f]] | |
(d/db conn) | |
(:db/id some-user)) | |
;; The above works fine if :user/friends is set, however, if it is unset | |
;; (no friends at all), popular? is never called and the result is nil. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment