Yves,

The following Jolt Chain spec should work:

[
  {
    "operation": "shift",
    "spec": {
      "contact": {
        "*": {
          "value": "contact.@(1,label).value",
          "comment": "contact.@(1,label).comment"
        }
      }
    }
  }
]

Regards,
Matt

On Fri, Nov 23, 2018 at 8:21 AM Yves HAMEL <[email protected]> wrote:
>
>
> Hi all,
> I have a input json :
>         {"contact": {
>                         "0": {"label":"pro",value:"123456","comment":"abc"},
>                         "1": {"label":"perso",value:"654321","comment":"def"},
>                 }}
> How can I write jolt transformation to get the following json
>         {"contact":{
>                 "pro":{value:"123456","comment":"abc"},
>                 "perso":{value:"654321","comment":"def"}
>                 }}
> Thanks
> Yves HAMEL
>
> (Embedded image moved to file: pic12164.jpg)
>
> Yves HAMEL
> Direction Digital & Systèmes d’Information Groupe
> LM_DATA
>
> MACIF - 2 et 4, rue Pied de Fond - 79037 Niort cedex 9
> Tél. : +33 (0)5 49 09 36 06
> Email : [email protected] / Pré Doyen 2 – bureau 999
>
> www.macif.fr - Appli présente sur Google Play Store & Apple Store
> (Embedded image moved to file: pic25542.jpg)

Reply via email to