0

I'm trying to write JMESPath for following structure:

{
    "example": [
        {
            "field": "value",
            "lst": [
                {
                    "inner_field": "fvalue"
                }
            ],
        }
    ]
}

The result I'm looking for is

[
    {
        "inner_field": "fvalue",
        "field": "value"
    }
]

With field being inserted into all dictionaries in lst. I'm aware of things like:

example[*].{field: field, lst: lst}

But is there a way to assign field for each element in lst?

Azzten
  • 13
  • 3

1 Answers1

0

Is this what you were expecting?

example[*].{field: field,inner_field: lst[0].inner_field}
ouflak
  • 2,458
  • 10
  • 44
  • 49
tintin
  • 1
  • 2