0

I'm using JOLT to transform data from:

[{"a" : "a",
  "b" : "b",
  "c" : "c",
  ...},
 {"a" : "a",
  "b" : "b",
  "c" : "c",
  ...}]

To:

[{"a1" : "a",
  "b1" : "b",
  "c1" : "c",
  ...},
 {"a1" : "a",
  "b1" : "b",
  "c1" : "c",
  ...}]

I'm trying to figure out a wild card that would map all the attributes I don't need to change. Something like:

[{
  "operation": "shift",
  "spec": {
    "*": {
      "a": "[&1].a1",
      "b": "[&1].b1",
      "c": "[&1].c1",
      "*": {
        "@": "&"
      }
    }
  }
}]

Where:

"*": {
        "@": "&"
      }

Would work as a wildcard for all the fields I don't need to update.

FTineo
  • 3
  • 2

1 Answers1

0

Spec

[{
  "operation": "shift",
  "spec": {
    "*": {
      "a": "[&1].a1",
      "b": "[&1].b1",
      "c": "[&1].c1",
      "*": "[&1].&"
    }
  }
}]
Milo S
  • 4,466
  • 1
  • 19
  • 22