Skip to content

Instantly share code, notes, and snippets.

@jdkealy
Created January 27, 2017 21:34
Show Gist options
  • Save jdkealy/b9d62366c46ba078051bad849e82c200 to your computer and use it in GitHub Desktop.
Save jdkealy/b9d62366c46ba078051bad849e82c200 to your computer and use it in GitHub Desktop.
(defn max-fk [org]
(ffirst
(d/q '[:find (max ?fk)
:in $ ?org
:where
[?collection :collection/organization ?org]
[?content :content/collection ?collection]
[?content :content/fk ?fk]]
(db/_d) org)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment