Skip to content

Instantly share code, notes, and snippets.

@jdkealy
Created February 3, 2017 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jdkealy/75451acf435a877df198abe4a028042c to your computer and use it in GitHub Desktop.
Save jdkealy/75451acf435a877df198abe4a028042c to your computer and use it in GitHub Desktop.
(defn max-fk-for-org
"query runs way too slow"
[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