DB2API'den dönen result değeri:

{
  "statusCode" : 200,
  "statusDescription" : "OK",
  "columnNames" : [ "customerNumber", "customerName", "contactLastName", "contactFirstName", "phone", "addressLine1", "addressLine2", "city", "state", "postalCode", "country", "salesRepEmployeeNumber", "creditLimit" ],
  "numRows" : 2,
  "data" : [ {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Carine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 103,
    "customerName" : "Atelier graphique",
    "phone" : "40.32.2555",
    "addressLine1" : "54, rue Royale",
    "creditLimit" : 21000.0,
    "contactLastName" : "Schmitt",
    "addressLine2" : null,
    "state" : null
  }, {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Janine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 119,
    "customerName" : "La Rochelle Gifts",
    "phone" : "40.67.8555",
    "addressLine1" : "67, rue des Cinquante Otages",
    "creditLimit" : 118200.0,
    "contactLastName" : "Labrune",
    "addressLine2" : null,
    "state" : null
  } ],
  "elapsedTime" : 11,
  "errors" : [ ]
}  
 
CODE


  • "data" elementinin ismini değiştiren ve diğer elemanlardan temizleyen JOLT örneği ve çıktısı:


-------------------------------------------
JOLT: 
--------------------------------------------  

[
  {
    "operation": "shift",
    "spec": {
          "data":"sonuç"
     }
  }
]

--------------------------------------------
SONUÇ
--------------------------------------------  
{
  "sonuç" : [ {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Carine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 103,
    "customerName" : "Atelier graphique",
    "phone" : "40.32.2555",
    "addressLine1" : "54, rue Royale",
    "creditLimit" : 21000.0,
    "contactLastName" : "Schmitt",
    "addressLine2" : null,
    "state" : null
  }, {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Janine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 119,
    "customerName" : "La Rochelle Gifts",
    "phone" : "40.67.8555",
    "addressLine1" : "67, rue des Cinquante Otages",
    "creditLimit" : 118200.0,
    "contactLastName" : "Labrune",
    "addressLine2" : null,
    "state" : null
  } ]
}

 
CODE
  • "data" elementinin içindeki "country" elemanlarını bir üst seviyeye çıkartan ve diğer elemanlardan temizleyen JOLT örneği ve çıktısı:


-------------------------------------------
JOLT:
-------------------------------------------

[
  {
    "operation": "shift",
    "spec": {
      "data": {
        "*": {
          "country": "&"
        }
      }
    }
  }
]

 
--------------------------------------------
SONUÇ
--------------------------------------------   

{
  "country": [
    "France",
    "France"
  ]
}
CODE


  • "data" elementinin içindeki "country" elemanlarının değerini bir üst seviyeye çıkartan ve diğer elemanlardan temizleyen JOLT örneği ve çıktısı:


-------------------------------------------
JOLT:
-------------------------------------------

[
  {
    "operation": "shift",
    "spec": {
      "data": {
        "*": {
          "country": "[&1]."
        }
      }
    }
  }
]


 
--------------------------------------------
SONUÇ
--------------------------------------------   

[
  "France",
  "France"
]
CODE