Created
August 17, 2020 20:48
-
-
Save vitalipe/f47eadc1d03e9b7ca9e9a2d18d53bd08 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (unpack | |
| ;; data | |
| {:parent {:nested [{:name "banana" :price 1} | |
| {:name "banana2" :price 2}]}} | |
| ;; query: | |
| {:all-names [:parent :nested [[:name]]] | |
| :all-names-in-caps [:parent :nested [[:name to-upper]]] | |
| :max-price [:parent :nested [[:price] *|> max]] | |
| :same+1-to-price {:parent [:parent {:nested [:nested [[{:name :name | |
| :price [:price inc]}]]]}]}}) | |
| ;; result: | |
| {:all-names ["banana" "banana2"] | |
| :all-names-in-caps ["BANANA" "BANANA2"] | |
| :max-price 2 | |
| :same+1-to-price {:parent | |
| {:nested [{:name "banana" :price 2} | |
| {:name "banana2" :price 3}]}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment