Something like Useful commands for jq
- to play around: https://jqplay.org/
[
{"a": 1, "e": "{\"hi\": \"there\"}"},
{"b": 2, "e": "{\"hi\": \"there\"}"}
]
jq '[.[] | .e |= fromjson]'
[
{
"a": 1,
"e": {
"hi": "there"
}
},
{
"b": 2,
"e": {
"hi": "there"
}
}
]
[ .[] ( do something here... ) ]
: select each item in the list and put it back into a list| .e |= fromjson
: applyfromjson
filter and replace the value
. | unique_by (.)
{
"items": [ "..." ]
}
jq '. + {"length": (.items | length)}'
{
"items": [ "..." ],
"length": 1
]
| { field, name }
. + {"copied": .fromOriginal }