<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NiFi Jolttransform to package json array into object? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Jolttransform-to-package-json-array-into-object/m-p/239519#M201328</link>
    <description>&lt;P&gt;how can i transform array of maps into array of values: ["one", "two", "three"] ?&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2019 23:23:47 GMT</pubDate>
    <dc:creator>lvic4594_</dc:creator>
    <dc:date>2019-05-03T23:23:47Z</dc:date>
    <item>
      <title>NiFi Jolttransform to package json array into object?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Jolttransform-to-package-json-array-into-object/m-p/239517#M201326</link>
      <description>&lt;P&gt;i have json array like the following: [{"id":"one"}, {"id,"two"}] Any idea how could i "package" it into json "root" like the following: {  [{"id":"one"}, {"id,"two"}]  }&lt;/P&gt;&lt;P&gt;I am trying to use JolttransformJSON but couldn't find any clues how to approach operation like this....&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 02:36:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Jolttransform-to-package-json-array-into-object/m-p/239517#M201326</guid>
      <dc:creator>lvic4594_</dc:creator>
      <dc:date>2019-05-03T02:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Jolttransform to package json array into object?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Jolttransform-to-package-json-array-into-object/m-p/239518#M201327</link>
      <description>&lt;P&gt;I don't think your desired output is valid JSON, as the root object only has an array in it, not a key/value pair. If you want a key in there (let's call it root) the following spec will work in JoltTransformJSON:&lt;/P&gt;&lt;PRE&gt;[
&amp;nbsp; {
&amp;nbsp; &amp;nbsp; "operation": "shift",
&amp;nbsp; &amp;nbsp; "spec": {
&amp;nbsp; &amp;nbsp; &amp;nbsp; "*": "root.[]"
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; }
]&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Otherwise if you just want to add braces around the array, you can use ReplaceText, replacing the entire thing with {$1}&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 03:51:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Jolttransform-to-package-json-array-into-object/m-p/239518#M201327</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2019-05-03T03:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Jolttransform to package json array into object?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Jolttransform-to-package-json-array-into-object/m-p/239519#M201328</link>
      <description>&lt;P&gt;how can i transform array of maps into array of values: ["one", "two", "three"] ?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 23:23:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Jolttransform-to-package-json-array-into-object/m-p/239519#M201328</guid>
      <dc:creator>lvic4594_</dc:creator>
      <dc:date>2019-05-03T23:23:47Z</dc:date>
    </item>
  </channel>
</rss>

