I have a json array returned from curl that looks like this:[ {   title: Some Title,   tags:tagA tag-B tagC }, {   title: Some Title 2,   tags:tagA tagC }, ...]I'd like to convert it to...[ {   title: Some Title,   tags:[tagA,           tag-B,           tagC] }, {   title: Some Title 2,   tags:[tagA,            tagC] }, ...]So far I have:(map(select(.tags!=null)) | map(.tags | split( ))) as $tags | $tagsand that appears to give me something like:     [      [       tagA,       tag-B,       tagC      ],      [       tagA,        tagC      ]     ]But I don't seem to be able to weave that back into an output that would give me .tags as an array in the original objects with the original values...
Split a sting field into an array in jq?
json;jq
You're making it a lot more complicated than it is.  Just use map() and |=:jq 'map(.tags |= split( ))' file.jsonEdit:If you want to handle entries without tags:jq 'map(try(.tags |= split( )))' file.jsonAlternatively, if you want to keep unchanged all entries without tags:jq 'map(try(.tags |= split( )) // .)' file.jsonResult:[  {    tags: [      tagA,      tag-B,      tagC    ],    title: Some Title  },  {    tags: [      tagA,      tagC    ],    title: Some Title 2  }]