@jumar I think he meant getting only the key-vals from a map with a certain namespace, if I recall correctly
at the same time I wondered why one would do that. it's not something I've probably done a lot
Yep, I thought there were actually two different things he mentioned. I guess that's because they prefer flattened maps instead of nested where you can easily just pick the subset represented by a single key
yes, that is correct
it might be useful to have a function for extracting all the keys with a given namespace, but I also haven't needed that very much
it might be nice for printing out a map if the keys were sorted by namespace
Just to put an example out there....
{:league/id "TLA"
:division/id :north-west
:team/id 87
:player/id 42
:player/name "shooter"
:player/role :dps}
We end up with lots of data like that.
And then we have stages in our pipeline that might enrich that with more dimensions.
Eg., we may mix in something like the team's name
:team/name "The Mighty Dragons"
So that "record" describes a bunch of dimensions that are applicable to that player.
Yes. Both problems. 1. Round-tripping namespaced keys through strings (because we have to go through JSON a lot) 2. Picking out all the key-value pairs that share a common namespace. Like a "select-keys" but for all keys matching a namespace.
I'd love a function that allows me to pull out all the player/...
key-value pairs.