Dataset Viewer
Auto-converted to Parquet Duplicate
pedido_nl
stringlengths
38
151
programa
stringlengths
4
117
familia
stringlengths
16
21
idioma
stringclasses
1 value
documentos
listlengths
2
2
saidas
listlengths
2
2
origem
dict
Return the Ids of all entries whose Names don't contain "data".
. - map(select(.Names[] | contains("data"))) | .[].Id
humana/Q26701538
en
[ "[{\"Id\":\"cb94e7a42732b598ad18a8f27454a886c1aa8bbba6167646d8f064cd86191e2b\",\"Names\":[\"condescending_jones\",\"loving_hoover\"]},{\"Id\":\"186db739b7509eb0114a09e14bcd16bf637019860d23c4fc20e98cbe068b55aa\",\"Names\":[\"foo_data\"]},{\"Id\":\"a4b7e6f5752d8dcb906a5901f7ab82e403b9dff4eaaeebea767a04bac4aada19\",\"...
[ "\"cb94e7a42732b598ad18a8f27454a886c1aa8bbba6167646d8f064cd86191e2b\"\n\"a4b7e6f5752d8dcb906a5901f7ab82e403b9dff4eaaeebea767a04bac4aada19\"", "\"aaa111\"\n\"ccc333\"" ]
{ "question_id": 26701538, "url": "https://stackoverflow.com/questions/26701538/jq-how-to-filter-an-array-of-objects-based-on-values-in-an-inner-array", "titulo": "jq: how to filter an array of objects based on values in an inner array?", "autor": "Abe Voelker", "votos": 518, "licenca": "CC BY-SA 4.0" }
How can I count the number of items in the array?
length
humana/Q21334348
en
[ "[{\"cid\":49,\"pyn\":\"yi4\",\"hans\":\"亿\",\"hant\":\"億\",\"tid\":68,\"l10n\":\"cent million\",\"pid\":1,\"pos\":\"num\",\"pos_txt\":\"\"},{\"cid\":50,\"pyn\":\"yi4\",\"hans\":\"亿\",\"hant\":\"億\",\"tid\":69,\"l10n\":\"100 millions\",\"pid\":1,\"pos\":\"num\",\"pos_txt\":\"\"}]", "[{\"cid\":1,\"pyn\":\"yi1\",\"...
[ "2", "3" ]
{ "question_id": 21334348, "url": "https://stackoverflow.com/questions/21334348/how-to-count-items-in-json-object-using-command-line", "titulo": "How to count items in JSON object using command line?", "autor": "Édouard Lopez", "votos": 474, "licenca": "CC BY-SA 4.0" }
Get the date of the "Sold" event from the property history, without failing when there is no property history.
.result | select(.property_history != null) | .property_history | map(select(.event_name == "Sold"))[0].date
humana/Q42097410
en
[ "{\"result\":{\"property_history\":[{\"date\":\"01/27/2016\",\"price_changed\":0,\"price\":899750,\"event_name\":\"Listed\",\"sqft\":0},{\"date\":\"12/15/2015\",\"price_changed\":0,\"price\":899750,\"event_name\":\"Listed\",\"sqft\":2357},{\"date\":\"08/30/2004\",\"price_changed\":0,\"price\":739000,\"event_name\":...
[ "\"08/30/2004\"", "" ]
{ "question_id": 42097410, "url": "https://stackoverflow.com/questions/42097410/how-to-check-for-presence-of-key-in-jq-before-iterating-over-the-values", "titulo": "How to check for presence of 'key' in jq before iterating over the values", "autor": "Rahul Dess", "votos": 124, "licenca": "CC BY-SA 4...
I would like to get rid of the timestamp field from every entry.
del(.[].timestamp)
humana/Q33895076-del
en
[ "[{\"timestamp\":1448369447295,\"group\":\"employees\",\"uid\":\"elgalu\"},{\"timestamp\":1448369447296,\"group\":\"employees\",\"uid\":\"mike\"},{\"timestamp\":1448369786667,\"group\":\"services\",\"uid\":\"pacts\"}]", "[{\"timestamp\":1500000000001,\"group\":\"admins\",\"uid\":\"root\"},{\"timestamp\":150000000...
[ "[{\"group\":\"employees\",\"uid\":\"elgalu\"},{\"group\":\"employees\",\"uid\":\"mike\"},{\"group\":\"services\",\"uid\":\"pacts\"}]", "[{\"group\":\"admins\",\"uid\":\"root\"},{\"group\":\"guests\",\"uid\":\"anon\"}]" ]
{ "question_id": 33895076, "url": "https://stackoverflow.com/questions/33895076/exclude-column-from-jq-json-output", "titulo": "Exclude column from jq json output", "autor": "Leo Gallucci", "votos": 85, "licenca": "CC BY-SA 4.0" }
Give me each group and uid together as one comma-separated value.
.[] | [.group, .uid] | join(",")
humana/Q33895076-join
en
[ "[{\"timestamp\":1448369447295,\"group\":\"employees\",\"uid\":\"elgalu\"},{\"timestamp\":1448369447296,\"group\":\"employees\",\"uid\":\"mike\"},{\"timestamp\":1448369786667,\"group\":\"services\",\"uid\":\"pacts\"}]", "[{\"timestamp\":1500000000001,\"group\":\"admins\",\"uid\":\"root\"},{\"timestamp\":150000000...
[ "\"employees,elgalu\"\n\"employees,mike\"\n\"services,pacts\"", "\"admins,root\"\n\"guests,anon\"" ]
{ "question_id": 33895076, "url": "https://stackoverflow.com/questions/33895076/exclude-column-from-jq-json-output", "titulo": "Exclude column from jq json output", "autor": "Leo Gallucci", "votos": 85, "licenca": "CC BY-SA 4.0" }
Check whether "orange" exists in the fruit array — give me its position, or null when it's absent.
.fruit | index("orange")
humana/Q43259563
en
[ "{\"fruit\":[\"apple\",\"orange\",\"pomegranate\",\"apricot\",\"mango\"]}", "{\"fruit\":[\"banana\",\"kiwi\"]}" ]
[ "1", "null" ]
{ "question_id": 43259563, "url": "https://stackoverflow.com/questions/43259563/how-to-check-if-element-exists-in-array-with-jq", "titulo": "How to check if element exists in array with jq", "autor": "idmitriev", "votos": 82, "licenca": "CC BY-SA 4.0" }
Sum the values in each of the objects key by key and output a single object.
map(to_entries) | add | group_by(.key) | map({key: .[0].key, value: map(.value) | add}) | from_entries
humana/Q28484534
en
[ "[{\"a\":10,\"b\":11},{\"a\":20,\"b\":21},{\"a\":30,\"b\":31}]", "[{\"x\":1},{\"x\":2,\"y\":5}]" ]
[ "{\"a\":60,\"b\":63}", "{\"x\":3,\"y\":5}" ]
{ "question_id": 28484534, "url": "https://stackoverflow.com/questions/28484534/how-do-i-sum-the-values-in-an-array-of-maps-in-jq", "titulo": "How do I sum the values in an array of maps in jq?", "autor": "Alan Burlison", "votos": 46, "licenca": "CC BY-SA 4.0" }
What is the required flag of the description column? It should come out as false when the field isn't set.
.columns.description | if has("required") then .required else false end
humana/Q56555155
en
[ "{\"columns\":{\"id\":{\"required\":true,\"type\":\"integer\"},\"name\":{\"required\":false,\"type\":\"string\"},\"description\":{\"type\":\"string\"}}}", "{\"columns\":{\"id\":{\"required\":true,\"type\":\"integer\"},\"description\":{\"required\":true,\"type\":\"string\"}}}" ]
[ "false", "true" ]
{ "question_id": 56555155, "url": "https://stackoverflow.com/questions/56555155/get-or-default-function-in-jq", "titulo": "Get or default function in JQ?", "autor": "Yun Huang", "votos": 30, "licenca": "CC BY-SA 4.0" }
For each item, remove the number, Language, and Country keys.
map(del(.Country, .number, .Language))
humana/Q36227245
en
[ "[{\"label\":\"US : USA : English\",\"Country\":\"USA\",\"region\":\"US\",\"Language\":\"English\",\"locale\":\"en\",\"currency\":\"USD\",\"number\":\"USD\"},{\"label\":\"AU : Australia : English\",\"Country\":\"Australia\",\"region\":\"AU\",\"Language\":\"English\",\"locale\":\"en\",\"currency\":\"AUD\",\"number\"...
[ "[{\"currency\":\"USD\",\"label\":\"US : USA : English\",\"locale\":\"en\",\"region\":\"US\"},{\"currency\":\"AUD\",\"label\":\"AU : Australia : English\",\"locale\":\"en\",\"region\":\"AU\"},{\"currency\":\"CAD\",\"label\":\"CA : Canada : English\",\"locale\":\"en\",\"region\":\"CA\"}]", "[{\"currency\":\"BRL\",...
{ "question_id": 36227245, "url": "https://stackoverflow.com/questions/36227245/deleting-multiple-keys-at-once-with-jq", "titulo": "Deleting multiple keys at once with jq", "autor": "antun", "votos": 78, "licenca": "CC BY-SA 4.0" }
Convert the object to key=value lines.
to_entries | map("\(.key)=\(.value|tostring)") | .[]
humana/Q25378013
en
[ "{\"var\":1,\"foo\":\"bar\",\"x\":\"test\"}", "{\"host\":\"localhost\",\"port\":8080,\"debug\":false}" ]
[ "\"var=1\"\n\"foo=bar\"\n\"x=test\"", "\"host=localhost\"\n\"port=8080\"\n\"debug=false\"" ]
{ "question_id": 25378013, "url": "https://stackoverflow.com/questions/25378013/how-to-convert-a-json-object-to-key-value-format-in-jq", "titulo": "How to convert a JSON object to key=value format in jq?", "autor": "gianebao", "votos": 74, "licenca": "CC BY-SA 4.0" }
For each company entry, build an object with the numeric companyId, its title as companyTitle and its booking service code as companyCode.
to_entries[] | {companyId: (.key)|tonumber, companyTitle: (.value.title), companyCode: (.value.booking_service_code)}
humana/Q48887711
en
[ "{\"1337\":{\"title\":\"Some company title\",\"booking_service_code\":\"oxo\"}}", "{\"42\":{\"title\":\"Acme\",\"booking_service_code\":\"acm\"},\"7\":{\"title\":\"Globex\",\"booking_service_code\":\"glx\"}}" ]
[ "{\"companyCode\":\"oxo\",\"companyId\":1337,\"companyTitle\":\"Some company title\"}", "{\"companyCode\":\"acm\",\"companyId\":42,\"companyTitle\":\"Acme\"}\n{\"companyCode\":\"glx\",\"companyId\":7,\"companyTitle\":\"Globex\"}" ]
{ "question_id": 48887711, "url": "https://stackoverflow.com/questions/48887711/how-to-convert-a-string-to-an-integer-in-a-json-file-using-jq", "titulo": "How to convert a string to an integer in a JSON file using jq?", "autor": "k0pernikus", "votos": 70, "licenca": "CC BY-SA 4.0" }
Convert the array of objects to one object whose keys are each element's name.
map({(.name|tostring): .}) | add
humana/Q42427725
en
[ "[{\"name\":\"A\",\"value\":\"1\"},{\"name\":\"B\",\"value\":\"5\"},{\"name\":\"E\",\"value\":\"8\"}]", "[{\"name\":\"K\",\"value\":\"9\"}]" ]
[ "{\"A\":{\"name\":\"A\",\"value\":\"1\"},\"B\":{\"name\":\"B\",\"value\":\"5\"},\"E\":{\"name\":\"E\",\"value\":\"8\"}}", "{\"K\":{\"name\":\"K\",\"value\":\"9\"}}" ]
{ "question_id": 42427725, "url": "https://stackoverflow.com/questions/42427725/using-jq-convert-array-of-objects-to-object-with-named-keys", "titulo": "Using jq, convert array of objects to object with named keys", "autor": "Mike N", "votos": 61, "licenca": "CC BY-SA 4.0" }
Rename the veg key to fruit2 and the worker key to job.
[.[] | .["fruit2"] = .veg | .["job"] = .worker | del(.veg, .worker)]
humana/Q43522133
en
[ "[{\"fruit\":\"strawberry\",\"veg\":\"apple\",\"worker\":\"gardener\"}]", "[{\"fruit\":\"mango\",\"veg\":\"kale\",\"worker\":\"chef\"},{\"fruit\":\"fig\",\"veg\":\"pea\",\"worker\":\"baker\"}]" ]
[ "[{\"fruit\":\"strawberry\",\"fruit2\":\"apple\",\"job\":\"gardener\"}]", "[{\"fruit\":\"mango\",\"fruit2\":\"kale\",\"job\":\"chef\"},{\"fruit\":\"fig\",\"fruit2\":\"pea\",\"job\":\"baker\"}]" ]
{ "question_id": 43522133, "url": "https://stackoverflow.com/questions/43522133/using-jq-how-can-i-replace-the-name-of-a-key-with-something-else", "titulo": "Using jq how can I replace the name of a key with something else", "autor": "user486670", "votos": 53, "licenca": "CC BY-SA 4.0" }
Keep only the addresses whose first character is a number.
map(select(.Address | test("^[0-9]")))
humana/Q50868203
en
[ "[{\"Address\":\"The Sq\"},{\"Address\":\"1 Bridge Rd\"}]", "[{\"Address\":\"22 Acacia Ave\"},{\"Address\":\"Rose Cottage\"},{\"Address\":\"7 High St\"}]" ]
[ "[{\"Address\":\"1 Bridge Rd\"}]", "[{\"Address\":\"22 Acacia Ave\"},{\"Address\":\"7 High St\"}]" ]
{ "question_id": 50868203, "url": "https://stackoverflow.com/questions/50868203/filter-by-regex-in-jq", "titulo": "Filter by Regex in JQ", "autor": "user49", "votos": 47, "licenca": "CC BY-SA 4.0" }
Find the first and the last entry of the waypoint cities.
.cruises[].waypoint_cities | first, last
humana/Q45979477
en
[ "{\"cruises\":[{\"waypoint_cities\":[\"Palma de Mallorca\",\"Cádiz\",\"Puerto del Rosario, Fuerteventura\",\"Arrecife, Lanzarote\",\"Arrecife, Lanzarote\",\"Agadir\",\"Gibraltar\",\"Barcelona\",\"Palma de Mallorca\"]}]}", "{\"cruises\":[{\"waypoint_cities\":[\"Lisbon\",\"Porto\",\"Faro\"]}]}" ]
[ "\"Palma de Mallorca\"\n\"Palma de Mallorca\"", "\"Lisbon\"\n\"Faro\"" ]
{ "question_id": 45979477, "url": "https://stackoverflow.com/questions/45979477/extract-the-first-and-the-last-value-of-a-json-array-object", "titulo": "Extract the first and the last value of a json array/object", "autor": "TimoC", "votos": 36, "licenca": "CC BY-SA 4.0" }
Sort descending by prop1 and, for ties, ascending by prop2.
sort_by(-.prop1, .prop2)
humana/Q35540294
en
[ "[{\"name\":\"Object 1\",\"prop1\":5,\"prop2\":2},{\"name\":\"Object 2\",\"prop1\":6,\"prop2\":4},{\"name\":\"Object 3\",\"prop1\":5,\"prop2\":3}]", "[{\"name\":\"P\",\"prop1\":1,\"prop2\":9},{\"name\":\"Q\",\"prop1\":3,\"prop2\":1},{\"name\":\"R\",\"prop1\":3,\"prop2\":0}]" ]
[ "[{\"name\":\"Object 2\",\"prop1\":6,\"prop2\":4},{\"name\":\"Object 1\",\"prop1\":5,\"prop2\":2},{\"name\":\"Object 3\",\"prop1\":5,\"prop2\":3}]", "[{\"name\":\"R\",\"prop1\":3,\"prop2\":0},{\"name\":\"Q\",\"prop1\":3,\"prop2\":1},{\"name\":\"P\",\"prop1\":1,\"prop2\":9}]" ]
{ "question_id": 35540294, "url": "https://stackoverflow.com/questions/35540294/sort-descending-by-multiple-keys-in-jq", "titulo": "Sort descending by multiple keys in jq", "autor": "Roland Weisleder", "votos": 36, "licenca": "CC BY-SA 4.0" }
Remove all the keys whose value is null from the object.
with_entries(select(.value != null))
humana/Q39500608
en
[ "{\"a\":1,\"b\":null,\"c\":null}", "{\"name\":\"Ela\",\"phone\":null,\"email\":\"ela@example.com\"}" ]
[ "{\"a\":1}", "{\"email\":\"ela@example.com\",\"name\":\"Ela\"}" ]
{ "question_id": 39500608, "url": "https://stackoverflow.com/questions/39500608/remove-all-null-values", "titulo": "Remove all null values", "autor": "Ela", "votos": 33, "licenca": "CC BY-SA 4.0" }
Change the format of the entry whose id is "baz" to "csv".
(.[] | select(.id == "baz") | .format) |= "csv"
humana/Q29772676
en
[ "[{\"format\":\"geojson\",\"id\":\"foo\"},{\"format\":\"geojson\",\"id\":\"bar\"},{\"format\":\"zip\",\"id\":\"baz\"}]", "[{\"format\":\"zip\",\"id\":\"baz\"},{\"format\":\"geojson\",\"id\":\"qux\"}]" ]
[ "[{\"format\":\"geojson\",\"id\":\"foo\"},{\"format\":\"geojson\",\"id\":\"bar\"},{\"format\":\"csv\",\"id\":\"baz\"}]", "[{\"format\":\"csv\",\"id\":\"baz\"},{\"format\":\"geojson\",\"id\":\"qux\"}]" ]
{ "question_id": 29772676, "url": "https://stackoverflow.com/questions/29772676/update-one-value-in-array-of-dicts-using-jq", "titulo": "Update one value in array of dicts, using jq", "autor": "Steve Bennett", "votos": 32, "licenca": "CC BY-SA 4.0" }
Give me the key names of the object, not the values.
keys
humana/Q23118341
en
[ "{\"email\":\"madireddy@test.com\",\"versionID\":\"2323\",\"context\":\"test\",\"date\":\"02-03-2014-13:41\",\"versionName\":\"application\"}", "{\"host\":\"api.example.com\",\"port\":8443,\"tls\":true}" ]
[ "[\"context\",\"date\",\"email\",\"versionID\",\"versionName\"]", "[\"host\",\"port\",\"tls\"]" ]
{ "question_id": 23118341, "url": "https://stackoverflow.com/questions/23118341/how-to-get-key-names-from-json-using-jq", "titulo": "How to get key names from JSON using jq", "autor": "Ezhilan Mahalingam", "votos": 314, "licenca": "CC BY-SA 4.0" }
Merge the two objects of this array into a single object; when a key exists in both, the second object wins, and nested objects are merged recursively.
.[0] * .[1]
humana/Q19529688
en
[ "[{\"value1\":200,\"timestamp\":1382461861,\"value\":{\"aaa\":{\"value1\":\"v1\",\"value2\":\"v2\"},\"bbb\":{\"value1\":\"v1\",\"value2\":\"v2\"},\"ccc\":{\"value1\":\"v1\",\"value2\":\"v2\"}}},{\"status\":200,\"timestamp\":1382461861,\"value\":{\"aaa\":{\"value3\":\"v3\",\"value4\":4},\"bbb\":{\"value3\":\"v3\"},\...
[ "{\"status\":200,\"timestamp\":1382461861,\"value\":{\"aaa\":{\"value1\":\"v1\",\"value2\":\"v2\",\"value3\":\"v3\",\"value4\":4},\"bbb\":{\"value1\":\"v1\",\"value2\":\"v2\",\"value3\":\"v3\"},\"ccc\":{\"value1\":\"v1\",\"value2\":\"v2\"},\"ddd\":{\"value3\":\"v3\",\"value4\":4}},\"value1\":200}", "{\"extra\":\"...
{ "question_id": 19529688, "url": "https://stackoverflow.com/questions/19529688/how-to-merge-2-json-objects-from-2-files-using-jq", "titulo": "How to merge 2 JSON objects from 2 files using jq?", "autor": "Janfy", "votos": 266, "licenca": "CC BY-SA 4.0" }
Build an object with a single "channel" key whose value is the profile_type and the member_key joined by a dot.
{channel: (.profile_type + "." + .member_key)}
humana/Q37710718
en
[ "{\"channel\":\"youtube\",\"profile_type\":\"video\",\"member_key\":\"hello\"}", "{\"channel\":\"vimeo\",\"profile_type\":\"audio\",\"member_key\":\"world\"}" ]
[ "{\"channel\":\"video.hello\"}", "{\"channel\":\"audio.world\"}" ]
{ "question_id": 37710718, "url": "https://stackoverflow.com/questions/37710718/concat-2-fields-in-json-using-jq", "titulo": "Concat 2 fields in JSON using jq", "autor": "darthsidious", "votos": 177, "licenca": "CC BY-SA 4.0" }
Append the entry {"status": "OK", "message": "run complete"} to the messages array inside data.
.data.messages += [{"status": "OK", "message": "run complete"}]
humana/Q42245288
en
[ "{\"report\":\"1.0\",\"data\":{\"date\":\"2010-01-07\",\"messages\":[{\"status\":\"OK\",\"message\":\"metadata loaded\"},{\"status\":\"NOK\",\"message\":\"metadata duplicated\"}]}}", "{\"report\":\"2.0\",\"data\":{\"date\":\"2011-02-08\",\"messages\":[]}}" ]
[ "{\"data\":{\"date\":\"2010-01-07\",\"messages\":[{\"message\":\"metadata loaded\",\"status\":\"OK\"},{\"message\":\"metadata duplicated\",\"status\":\"NOK\"},{\"message\":\"run complete\",\"status\":\"OK\"}]},\"report\":\"1.0\"}", "{\"data\":{\"date\":\"2011-02-08\",\"messages\":[{\"message\":\"run complete\",\"...
{ "question_id": 42245288, "url": "https://stackoverflow.com/questions/42245288/add-new-element-to-existing-json-array-with-jq", "titulo": "Add new element to existing JSON array with jq", "autor": "Felipe", "votos": 133, "licenca": "CC BY-SA 4.0" }
Out of the entries whose "a" equals "x", give me the second one.
[.[] | select(.a == "x")][1]
humana/Q38500363
en
[ "[{\"a\":\"x\",\"b\":true},{\"a\":\"x\",\"b\":false},{\"a\":\"XML\",\"b\":false}]", "[{\"a\":\"y\",\"b\":true},{\"a\":\"x\",\"b\":1},{\"a\":\"x\",\"b\":2},{\"a\":\"x\",\"b\":3}]" ]
[ "{\"a\":\"x\",\"b\":false}", "{\"a\":\"x\",\"b\":2}" ]
{ "question_id": 38500363, "url": "https://stackoverflow.com/questions/38500363/get-the-first-or-nth-element-in-a-jq-json-parsing", "titulo": "get the first (or n'th) element in a jq json parsing", "autor": "Demian Glait", "votos": 128, "licenca": "CC BY-SA 4.0" }
Keep only the images that have no tag containing "latest".
map(select(all(.imageTags[]; contains("latest") | not)))
humana/Q42746828
en
[ "[{\"imageDigest\":\"sha256:d1\",\"imageTags\":[\"v1.0\",\"latest\"]},{\"imageDigest\":\"sha256:d2\",\"imageTags\":[\"v0.9\"]},{\"imageDigest\":\"sha256:d3\",\"imageTags\":[\"rc-latest\"]}]", "[{\"imageDigest\":\"sha256:a1\",\"imageTags\":[\"stable\"]},{\"imageDigest\":\"sha256:a2\",\"imageTags\":[\"nightly\"]}]"...
[ "[{\"imageDigest\":\"sha256:d2\",\"imageTags\":[\"v0.9\"]}]", "[{\"imageDigest\":\"sha256:a1\",\"imageTags\":[\"stable\"]},{\"imageDigest\":\"sha256:a2\",\"imageTags\":[\"nightly\"]}]" ]
{ "question_id": 42746828, "url": "https://stackoverflow.com/questions/42746828/jq-how-to-query-for-array-values-that-dont-contain-text-foo", "titulo": "jq: how to query for array values that don't contain text "foo"?", "autor": "Gavriel Fishel", "votos": 92, "licenca": "CC BY-SA 4.0" }
When the person's details say their name is "James Brown", output the id together with that name.
select(.details.name == "James Brown") | {id, name: .details.name}
humana/Q38689645
en
[ "{\"id\":1,\"details\":{\"username\":\"jamesbrown\",\"name\":\"James Brown\"}}", "{\"id\":2,\"details\":{\"username\":\"amywinehouse\",\"name\":\"Amy Winehouse\"}}" ]
[ "{\"id\":1,\"name\":\"James Brown\"}", "" ]
{ "question_id": 38689645, "url": "https://stackoverflow.com/questions/38689645/how-do-i-print-a-parent-value-of-an-object-when-i-am-already-deep-into-the-objec", "titulo": "How do I print a parent value of an object when I am already deep into the object's children?", "autor": "x3nr0s", "votos": 75, "l...
Group the entries by component and produce one object that maps each component to the list of its ips.
group_by(.component) | map({(.[0].component): map(.ip)}) | add
humana/Q43221453
en
[ "[{\"ip\":\"1.1.1.1\",\"component\":\"name1\"},{\"ip\":\"1.1.1.2\",\"component\":\"name1\"},{\"ip\":\"1.1.1.3\",\"component\":\"name2\"},{\"ip\":\"1.1.1.4\",\"component\":\"name2\"}]", "[{\"ip\":\"10.0.0.1\",\"component\":\"web\"},{\"ip\":\"10.0.0.2\",\"component\":\"db\"}]" ]
[ "{\"name1\":[\"1.1.1.1\",\"1.1.1.2\"],\"name2\":[\"1.1.1.3\",\"1.1.1.4\"]}", "{\"db\":[\"10.0.0.2\"],\"web\":[\"10.0.0.1\"]}" ]
{ "question_id": 43221453, "url": "https://stackoverflow.com/questions/43221453/jq-group-and-key-by-property", "titulo": "jq: group and key by property", "autor": "replay", "votos": 56, "licenca": "CC BY-SA 4.0" }
Output the object only when its requests array is non-empty; otherwise output nothing at all.
if (.requests | length) != 0 then . else empty end
humana/Q29949184
en
[ "{\"requests\":[{\"id\":\"123\"},{\"id\":\"456\"}]}", "{\"requests\":[]}" ]
[ "{\"requests\":[{\"id\":\"123\"},{\"id\":\"456\"}]}", "" ]
{ "question_id": 29949184, "url": "https://stackoverflow.com/questions/29949184/json-jq-if-without-else", "titulo": "JSON JQ if without else", "autor": "user1578872", "votos": 53, "licenca": "CC BY-SA 4.0" }
For each entry, extract the id and the info-spec value from inside stuff.
.[] | {id, "info-spec": .stuff["info-spec"]}
humana/Q27562424
en
[ "[{\"id\":12345678,\"stuff\":{\"book\":\"shelf\",\"hook\":\"line\",\"info-spec\":12},\"votes\":23},{\"id\":12345679,\"stuff\":{\"book\":\"maker\",\"hook\":\"sinker\",\"info-spec\":23},\"votes\":1}]", "[{\"id\":1,\"stuff\":{\"info-spec\":99},\"votes\":0}]" ]
[ "{\"id\":12345678,\"info-spec\":12}\n{\"id\":12345679,\"info-spec\":23}", "{\"id\":1,\"info-spec\":99}" ]
{ "question_id": 27562424, "url": "https://stackoverflow.com/questions/27562424/jq-nested-object-extract-top-level-id-and-lift-a-value-from-internal-object", "titulo": "jq: nested object, extract top-level id and lift a value from internal object", "autor": "tripleee", "votos": 42, "licenca": "CC BY-SA 4.0"...
Sum the duration of all entries into a single number.
map(.duration) | add
humana/Q52065570
en
[ "[{\"duration\":1211789},{\"duration\":373585},{\"duration\":495379}]", "[{\"duration\":10},{\"duration\":32}]" ]
[ "2080753", "42" ]
{ "question_id": 52065570, "url": "https://stackoverflow.com/questions/52065570/how-do-i-sum-all-numbers-from-output-of-jq", "titulo": "How do I sum all numbers from output of jq", "autor": "toy", "votos": 40, "licenca": "CC BY-SA 4.0" }
Flatten each entry: replace the fields object by its contents, unwrapping every single-element array to its first value.
map(del(.fields) + (.fields | map_values(first)))
humana/Q24698188
en
[ "[{\"index\":\"index1\",\"type\":\"type1\",\"id\":\"id1\",\"fields\":{\"deviceOs\":[\"Android\"],\"deviceID\":[\"deviceID1\"],\"type\":[\"type\"],\"country\":[\"DE\"]}},{\"index\":\"index2\",\"type\":\"type2\",\"id\":\"id2\",\"fields\":{\"deviceOs\":[\"Android\"],\"deviceID\":[\"deviceID2\"],\"type\":[\"type\"],\"c...
[ "[{\"country\":\"DE\",\"deviceID\":\"deviceID1\",\"deviceOs\":\"Android\",\"id\":\"id1\",\"index\":\"index1\",\"type\":\"type\"},{\"country\":\"US\",\"deviceID\":\"deviceID2\",\"deviceOs\":\"Android\",\"id\":\"id2\",\"index\":\"index2\",\"type\":\"type\"}]", "[{\"lang\":\"pt\",\"name\":\"n1\",\"tier\":\"gold\"}]"...
{ "question_id": 24698188, "url": "https://stackoverflow.com/questions/24698188/flatten-a-json-document-using-jq", "titulo": "Flatten a JSON document using jq", "autor": "Dror", "votos": 38, "licenca": "CC BY-SA 4.0" }

jq-bench — execution-verified benchmark for natural language → jq

Part of the jq-coder project — all artifacts · jq-coder-0.6B model · jqc CLI

A benchmark for natural-language-to-jq translation built from real questions asked by real people — not from a synthetic grammar. 30 hand-curated tasks derived from real StackOverflow questions, with gold filters and gold outputs verified by executing real jq — no LLM-as-judge anywhere: scoring is run the filter, diff the canonical output.

It is the canonical evaluation set of jq-coder-0.6B, but it is model-agnostic: any system that turns a natural-language request (+ a JSON sample) into a jq filter can be scored on it.

Why a human slice

Synthetic benchmarks generated by the same grammar that generated the training data measure in-distribution memorization, not competence. This slice is independent of any generation grammar by construction: every item comes from a real question asked by a real person, and questions that seeded the jq-coder training grammar (the top-voted tier) are explicitly excluded. The items favor constructs and compositions that synthetic grammars tend to miss: del, with_entries, compound to_entries, index, first/last, descending sort_by, regex test, if-has-else, update assignment |=, array subtraction, join, keys, recursive merge *, += on nested paths, group_by into a dynamic-key object, map_values, and hyphenated-key projection (.stuff["info-spec"]).

Format

One JSON object per line in humana.jsonl:

Field Meaning
pedido_nl The natural-language request (the question author's intent, tool mentions removed)
programa Gold jq filter (accepted answer, adapted to a pure filter — no -r/-s/shell flags)
familia humana/Q<question_id> — unique per item
idioma Request language (en)
documentos ≥2 input JSON documents: the original from the question plus a variant with the same skeleton
saidas Gold outputs, one per document, canonical jq -cS
origem Provenance: StackOverflow question_id, url, titulo, autor, votos, licenca

Every gold output was computed by running the gold filter with real jq (1.8) and is re-validated automatically by the project's test suite — curation you can re-execute, not curation you have to trust.

Scoring

Run the candidate filter against every document of the item and diff the canonical output (jq -cS) against gold. Two published metrics:

  • strict — byte-identical to gold on all documents;
  • task-solved — additionally accepts equivalent output shapes (stream vs. array wrapper and similar convention differences).

An item only counts if all its documents pass — a filter that hardcodes values from the sample fails the variant document.

Baseline

Model strict task-solved
jq-coder-0.6B (v14, Q8_0) 10/30 11/30
jq-coder-0.6B (v13, Q8_0) 9/30 10/30

Yes, the human slice is hard — that is the point: these are compositions real people actually needed, not grammar samples. Reference scores for frontier models and for the base model (zero-shot) are on the roadmap.

License and attribution

StackOverflow content is CC BY-SA 4.0; this dataset is redistributed under the same license. Each item carries per-item attribution in origem: the question URL, the author's display name, and the vote count at collection time. The gold programs are adapted from the accepted answers of the linked questions.

If you use jq-bench, please cite:

@misc{jqbench2026,
  title   = {jq-bench: an execution-verified benchmark for natural-language-to-jq translation},
  author  = {Edelmar Schneider},
  year    = {2026},
  url     = {https://huggingface.co/datasets/DominuZ/jq-bench}
}
Downloads last month
48

Collection including DominuZ/jq-bench