-
Notifications
You must be signed in to change notification settings - Fork 3
Open
jmespath/jmespath.site
#21Labels
enhancementNew feature or requestNew feature or request
Description
Let's say I have
{
'bark': 'oink',
'foo1': 'foo',
'foo2': 'woof',
'foo3': 'meow'
}and want to select all values for which keys start with "foo". I tried for a bit to get JMESPath to get me ['foo', 'woof', 'meow'] but was unsuccessful. I don't know if it's impossible, but I was thinking that a simple approach might be a built-in function called pivot/reify/mappings (I'm bad at naming) that transforms the above into a list of Key/Value mappings, so:
[
{ 'Key': 'bark', 'Value': 'oink' },
{ 'Key': 'foo1', 'Value': 'foo' },
{ 'Key': 'foo2', 'Value': 'woof' },
{ 'Key': 'foo3', 'Value': 'meow' }
]which seems far easier to deal with. I'm open to other approaches to achieving the same goal, of course 😄
velavokr, dhouck, anton-ryzhov, realdimas, myrdd and 4 more
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request