Fork me on GitHub
#specter
<
2016-09-30
>
joshkh16:09:08

I'm pretty sure I've asked this before but I can't seem to find the answer. Is subselect the right way to match conditions "deeper" into a tree yet transform higher up?

joshkh16:09:05

I realize there's no matching function in this subselect, but still I would have expected found to be farther up the tree. Instead it's the just the :id which is the last part of the subselect

(s/transform [:data s/ALL #(= "interactor" (:object %)) (s/subselect [:identifier :id])]
                 (fn [found] (println "FOUND" found))
                 (:data db))

nathanmarz17:09:20

@rodeorockstar it sounds like you're looking for selected?

nathanmarz17:09:19

but [:identifier :id] will always match something, maybe you wanted to use [(must :identifier) (must :id)]?