BJ5
BJ5

Reputation: 512

Jolt spec convert 2d array to 1d array

How to convert 2d array to 1d array

{ "test": [ ["1", "2", "3"], ["4"] ] }

to

{ "test" : ["1", "2", "3", "4"] }

I tried multiple things and it didn't work

Upvotes: 0

Views: 86

Answers (1)

mattyb
mattyb

Reputation: 12083

This spec should do the trick:

[
  {
    "operation": "shift",
    "spec": {
      "test": {
        "*": {
          "*": "test"
        }
      }
    }
  }
]

Upvotes: 2

Related Questions