title: Transforming Array of objects with nested array objects using JOLT
body: <p>I want to transform following input JSON to output JSON format</p>
  
  <p><strong>INPUT JSON:</strong></p>
  
  <pre><code>[
    {
      "orderNumber": "201904-000000001",
      "items": [
        {
          "itemPrice": 40000,
          "itemQuantity": 11,
          "item": {
            "external_id": "IPHONE"
          }
        },
        {
          "itemPrice": 25000,
          "itemQuantity": 22,
          "item": {
            "external_id": "ONEPLUS"
          }
        },
        {
          "itemPrice": 35000,
          "itemQuantity": 33,
          "item": {
            "external_id": "SAMSUNGS10"
          }
        }
      ]
    }
  ]
  </code></pre>
  
  <p><strong>OUTPUT JSON:</strong></p>
  
  <pre><code>[{
    "orderNumber" : "201904-000000001",
    "items" : [ {
      "itemQuantity" : 11,
      "external" : "IPHONE"
    } ]
  },
  {
    "orderNumber" : "201904-000000001",
    "items" : [ {
      "itemQuantity" : 22,
      "external" : "ONEPLUS"
    } ]
  },
  {
    "orderNumber" : "201904-000000001",
    "items" : [ {
      "itemQuantity" : 33,
      "external" : "SAMSUNGS10"
    } ]
  }]
  </code></pre>
  
  <p>I have tried following spec which is not working...could someone guide me about spec I should use and explain each step if possible if nested arrays and objects are even deeper how to convert</p>
  
  <p><strong>SPEC I HAVE USED:</strong></p>
  
  <pre><code>[
    {
      "operation": "shift",
      "spec": {
        "*": {
          "orderNumber": "[&amp;1].orderNumber",
          "items": {
            "*": {
              "itemQuantity": "[&amp;1].items[].itemQuantity",
              "item": {
                "external_id": "[&amp;1].items[].external"
              }
            }
          }
        }
      }
  }
  ]
  </code></pre>