How to achieve following using JMESPath?
Input:
[
{"letter": "A", "word": "Apple"},
{"letter": "B", "word": "Ball"},
{"letter": "C", "word": "Cat"}
]
Expected Output:
[
{"A": "Apple"},
{"B": "Ball"},
{"C": "Cat"}
]
I have tried the following, but, it does not work for key while it works for value:
[].{@.letter: @.word}
Fairly a simple requirement, should be a small thing I am missing here.