specter

Latest version: 1.1.3
blak3mill3r 2021-06-08T01:28:00.007100Z

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

blak3mill3r 2021-06-08T01:28:30.007400Z

I'd love to be wrong though

blak3mill3r 2021-06-08T02:05:21.010200Z

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

blak3mill3r 2021-06-08T02:07:28.010900Z

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

blak3mill3r 2021-06-08T02:11:34.011500Z

I mean, compare your transformed solution to this:

blak3mill3r 2021-06-08T02:12:20.012400Z

(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}]

2021-06-08T15:11:03.013400Z

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.