Fork me on GitHub
#specter
<
2021-06-08
>
blak3mill3r01:06:00

transformed is, I think, the simplest way to do that

blak3mill3r01:06:30

I'd love to be wrong though

blak3mill3r02:06:21

I tried to do it the other way around, start navigating from :members and then use selected? but I don't think that works.

blak3mill3r02:06:28

I have settled for calling select twice in this case because I find the transformed approach a little harder to parse

blak3mill3r02:06:34

I mean, compare your transformed solution to this:

blak3mill3r02:06:20

(def structure
  {:guild {:a {:members ["1234" "1235"]}
           :b {:members ["2345"]}}
   :members {"1234" 1
             "2345" 2
             "1235" 3}})
(select [:members (submap
                   (select [:guild :a :members ALL] structure))]
        structure)
;; => [{"1234" 1, "1235" 3}]

Joshua Suskalo15:06:03

That makes sense. It just would be nice imo to be able to get those keys from the collected values in a navigator rather than having to make a second select operation.