Skip to content

Instantly share code, notes, and snippets.

@mpenet
Last active December 17, 2015 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpenet/5560708 to your computer and use it in GitHub Desktop.
Save mpenet/5560708 to your computer and use it in GitHub Desktop.
;; example of query that takes results by pairs,
;; and uses the last value of x to create the new chunks, incrementing its value.
(lazy-query (select :items
(limit 2)
(where {:x 1}))
(fn [query coll]
(merge query (where {:x (-> coll last :x inc)}))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment