Fork me on GitHub
#specter
<
2018-07-26
>
roklenarcic19:07:49

I have a double nested map like {:a {:b 1}} and I need get all tuples key1, key2, value where value fits a predicate

roklenarcic19:07:06

Is there some way I can do this?

nathanmarz19:07:50

@roklenarcic

(def m {:a {:b 1 :c 2} :d {:e 3 :f 4}})
(def VALS-WITH-KEY (path ALL (collect-one FIRST) LAST))
(select [VALS-WITH-KEY VALS-WITH-KEY even?] m)

roklenarcic19:07:27

hm I really need to experiment with subpaths more

roklenarcic19:07:22

using path operator is good for performance?