Add the following to the end of your shift spec:

"*": "&"

This (at the root) matches any key not already matched and puts it in
the output at the same location.

Regards,
Matt

On Tue, Sep 4, 2018 at 11:39 AM l vic <lvic4...@gmail.com> wrote:
>
> Hi,
> I want to "flatten" the following object:
> {
>     "id": 0,
>     "name": "Root",
>      "mylist": [{
>       "id": 10,
>       "info": "2am-3am"
>     },
>     {
>         "id": 11,
>         "info": "3AM-4AM"
>     },
>     {
>         "id": 12,
> "info": "4am-5am"
>     }]
> }
> I figured how to "flatten" array, but "root" values are gone in transformed 
> output:
> {
>    "mylist-0-id":10,
>    " mylist-0-info":"2am-3am",
> ....
> }
> How can I retain "root" fields so that transformed output would like like one 
> below?
> {
>      "id": 0,
>     "name": "Root",
>      "mylist-0-id":10,
>    " mylist-0-info":"2am-3am",
> ....
> }
>
>

Reply via email to