Skip to content

Instantly share code, notes, and snippets.

@jdkealy
Last active August 29, 2017 17:24
Show Gist options
  • Save jdkealy/2a66596428465b2f2462458e1ca54a3f to your computer and use it in GitHub Desktop.
Save jdkealy/2a66596428465b2f2462458e1ca54a3f to your computer and use it in GitHub Desktop.
; the query
(d/q '[:find ?price ?pt ?type
:in $ $shard ?cid ?type
:where
[$shard ?e :content/collection ?coll]
[$shard ?e :content/price_tier ?pt]
[$shard ?coll :collection/organization ?user]
[$ ?user :user/prices ?p]
[$ ?p :price/price ?price]
[$ ?p :price/type ?type]
[$ ?p :price/tier ?pt]]
_db _shard id usage)
; the inputs
db1 db2 17592186045769 :print
; the result
[[600.0 2 :print], [400.0 1 :print], [800.0 3 :print]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment