The split-jsonpath transformation extracts values from a specified location in the JSON value of a specified property. The transformation replaces the JSON value of the property with the extracted values. No other properties are created or modified by this transformation.

For example, suppose that the following JSON has been assigned as the value of a property named product.jsondata:

{ 
  "product.name": "Suede Shoes", 
  "product.childSKUs": [
    { 
      "sku.id": "1000-R-M8", 
      "shoe.color": "Red", 
      "shoe.size": "8" 
    }, 
    { 
      "sku.id": "1000-B-M8",
    		"shoe.color": "Blue", 
      "shoe.size": "8" 
    }, 
    ... 
  ] 
}

The following split-jsonpath transformation replaces the JSON value of the property product.jsondata with values that it extracts from the JSON value:

{ 
		  "ecr:type": "attributes-owner-folder", 
    "product.jsondata": {
			   "ecr:type": "dimension", 
      "isAutogen": true, 
      "indexingTransforms": [ 
        {
	      		 "transform": "split-jsonpath", 
          "sourcePropertyNames": [
            "product.jsondata" 
          ],
			   "jsonPaths": [
        "$['product.childSKUs'][*]['sku.id]",
			     "$['product.childSKUs'][*]['shoe.size']",
			     "$['product.childSKUs'][*]['shirt.size']" 
] } ] } }

The split-jsonpath transformation assigns the extracted values to product.jsondata as follows:

 "product.jsondata": "1000-R-M8", 
 "product.jsondata": "8",
	"product.jsondata": "Red", 
 "product.jsondata": "Blue" 

The following table lists the properties of a split-jsonpath transformation:


Copyright © Legal Notices