You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Nicolas Peltier (Jira)" <ji...@apache.org> on 2021/11/30 09:47:00 UTC

[jira] [Closed] (SLING-8651) JsonPipe: Add index option

     [ https://issues.apache.org/jira/browse/SLING-8651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Peltier closed SLING-8651.
----------------------------------

> JsonPipe: Add index option
> --------------------------
>
>                 Key: SLING-8651
>                 URL: https://issues.apache.org/jira/browse/SLING-8651
>             Project: Sling
>          Issue Type: New Feature
>          Components: pipes
>    Affects Versions: Pipes 3.1.0
>            Reporter: Ilyas Türkben
>            Assignee: Nicolas Peltier
>            Priority: Major
>             Fix For: Pipes 4.3.2
>
>
> Given the following pipe:
> {code:java}
> .json('').with('valuePath','$')
> .name('item')
> .mkdir('${basePath}/jcr:content/config/item${item.index}'){code}
> where json pipe receives a JSON file containing an array of objects and I would like to use
> the index of objects in the array when I create nodes using mkdir.
> Currently, my JSON file has those indexes hard coded.
> Considering {{item.index}} might be a custom property in my json file, I propose to use {{$index}} for that purpose.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)