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 😄
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 calledpivot/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 😄