1

is this doable with JMESPath?

i want to transform this

{
  "common":  "value",  
  "subdicts": {
    "first": {"sub" : 10},
    "second": { "sub": 20}
  }
}

to

[
  {"common": "value",  "sub": 10}, 
  {"common": "value", "sub": 20}
]
4

1 回答 1

0

你可以使用它。

[
   {
      Common:common,
      Sub:subdicts.first.sub
   },
   {
      Common:common,
      Sub:subdicts.second.sub
   }
]

结果

[
  {
    "Common": "value",
    "Sub": 10
  },
  {
    "Common": "value",
    "Sub": 20
  }
]
于 2017-10-24T19:41:01.977 回答