%dw 2.0
input records application/json
input fieldName text
output application/json
---
{(records map (record) ->
( record[ fieldName ] ) : record
)}
%dw 2.0
input records application/json
input fieldName text
output application/json
---
{(records map (record) ->
( record[ fieldName ] ) : record
)}