bazaarvoice / jolt

JSON to JSON transformation library written in Java.
Apache License 2.0
1.56k stars 329 forks source link

How to compare/filter based on dynamic field values in jolt #1032

Open buckyballs opened 4 years ago

buckyballs commented 4 years ago

Input:

{
  "Fruits": [
    {
      "FruitFullName": "Orange",
      "shortName": "O"
    },
    {
      "FruitFullName": "Apple",
      "shortName": "A"
    },
    {
      "FruitFullName": "Mango",
      "shortName": "M"
    }
  ],
  "shortName": "M"
}

Spec:

?

Desired output:

{
   "result": {
      "FruitFullName": "Mango",
      "shortName": "M"
    }
}

Note: shortName can have any value which is used to filter results from Fruits array.