[ 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)