request stringlengths 13 923 | response dict |
|---|---|
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 10; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.score | type) == \"number\" and .score >= 10))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 12; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.score | type) == \"number\" and .score >= 12))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 15; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.score | type) == \"number\" and .score >= 15))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 20; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.score | type) == \"number\" and .score >= 20))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains "a"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\"a\")) != null) or ((.name | type) == \"string\" and (.name | contains(\"a\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains "e"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\"e\")) != null) or ((.name | type) == \"string\" and (.name | contains(\"e\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains "i"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\"i\")) != null) or ((.name | type) == \"string\" and (.name | contains(\"i\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains "o"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\"o\")) != null) or ((.name | type) == \"string\" and (.name | contains(\"o\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains "O"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\"O\")) != null) or ((.name | type) == \"string\" and (.name | contains(\"O\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains "u"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\"u\")) != null) or ((.name | type) == \"string\" and (.name | contains(\"u\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains ","; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\",\")) != null) or ((.name | type) == \"string\" and (.name | contains(\",\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` contains "'"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.name | type) == \"array\" and (.name | index(\"'\"'\"'\")) != null) or ((.name | type) == \"string\" and (.name | contains(\"'\"'\"'\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix "A"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"A\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix "E"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"E\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix "O"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"O\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix "P"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"P\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix "N"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"N\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix "Q"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"Q\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix ""; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `name` prefix "H"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(((.name | type) == \"string\" and (.name | startswith(\"H\"))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `note` is null or missing; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.note == null)))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `note` is neither null nor empty; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.note != null and .note != \"\" and .note != [] and .note != {}))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `active` is the boolean true; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.active == true)))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq "Paris"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == \"Paris\")))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq "Oslo"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == \"Oslo\")))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq null; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == null)))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq "Berlin"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == \"Berlin\")))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq ""; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == \"\")))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq "London"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == \"London\")))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq "Quito"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == \"Quito\")))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `profile.city` eq "missing"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.city == \"missing\")))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `tags` contains "ops"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.tags | type) == \"array\" and (.tags | index(\"ops\")) != null) or ((.tags | type) == \"string\" and (.tags | contains(\"ops\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `tags` contains "red"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.tags | type) == \"array\" and (.tags | index(\"red\")) != null) or ((.tags | type) == \"string\" and (.tags | contains(\"red\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `tags` contains "blue"; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((((.tags | type) == \"array\" and (.tags | index(\"blue\")) != null) or ((.tags | type) == \"string\" and (.tags | contains(\"blue\")))))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `name`, `dept`, `score`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map({\"id\": .id, \"name\": .name, \"dept\": .dept, \"score\": .score}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `profile.city`, `profile.rank`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map({\"id\": .id, \"profile.city\": .profile.city, \"profile.rank\": .profile.rank}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; sort by `score` asc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | ((map(select(.score != null)) | to_entries | sort_by([.value.score, .key]) | map(.value)) + map(select(.score == null))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; sort by `name` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | ((map(select(.name != null)) | sort_by(.name) | group_by(.name) | reverse | add) + map(select(.name == null))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; sort by `profile.rank` asc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | ((map(select(.profile.rank != null)) | to_entries | sort_by([.value.profile.rank, .key]) | map(.value)) + map(select(.profile.rank == null))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; retain the first record for each distinct `dept` value; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | reduce .[] as $row ([]; if any(.[]; .dept == ($row | .dept)) then . else . + [$row] end))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; retain the first record for each distinct `profile.city` value; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | reduce .[] as $row ([]; if any(.[]; .profile.city == ($row | .profile.city)) then . else . + [$row] end))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; retain the first record for each distinct `active` value; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | reduce .[] as $row ([]; if any(.[]; .active == ($row | .active)) then . else . + [$row] end))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; count all records; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | length)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; count records whose `score` is present and non-null; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.score != null)) | length)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the sum of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.score | type) == \"number\") | .score) | add // 0)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the avg of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.score | type) == \"number\") | .score) as $n | if ($n|length)==0 then null else ($n|add)/($n|length) end)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the min of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.score | type) == \"number\") | .score) as $n | if ($n|length)==0 then null else ($n|min) end)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the max of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.score | type) == \"number\") | .score) as $n | if ($n|length)==0 then null else ($n|max) end)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; count records whose `profile.rank` is present and non-null; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.profile.rank != null)) | length)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the sum of `profile.rank`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.profile.rank | type) == \"number\") | .profile.rank) | add // 0)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the avg of `profile.rank`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.profile.rank | type) == \"number\") | .profile.rank) as $n | if ($n|length)==0 then null else ($n|add)/($n|length) end)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the min of `profile.rank`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.profile.rank | type) == \"number\") | .profile.rank) as $n | if ($n|length)==0 then null else ($n|min) end)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; return the max of `profile.rank`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select((.profile.rank | type) == \"number\") | .profile.rank) as $n | if ($n|length)==0 then null else ($n|max) end)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; count records whose `id` is present and non-null; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(select(.id != null)) | length)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; add `score_scaled` as numeric `score` multiplied by 2 (null when `score` is not numeric); write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(. + {\"score_scaled\": (if (.score|type)==\"number\" then (if 2 == 0 or .score == 0 then 0 else .score * 2 end) else null end)}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; add `score_scaled` as numeric `score` multiplied by 3 (null when `score` is not numeric); write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(. + {\"score_scaled\": (if (.score|type)==\"number\" then (if 3 == 0 or .score == 0 then 0 else .score * 3 end) else null end)}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; add `score_scaled` as numeric `score` multiplied by 10 (null when `score` is not numeric); write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(. + {\"score_scaled\": (if (.score|type)==\"number\" then (if 10 == 0 or .score == 0 then 0 else .score * 10 end) else null end)}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; add `note_or_dash` using "-" when `note` is null or empty; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(. + {\"note_or_dash\": (if .note == null or .note == \"\" then \"-\" else .note end)}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; add `note_or_dash` using "unknown" when `note` is null or empty; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(. + {\"note_or_dash\": (if .note == null or .note == \"\" then \"unknown\" else .note end)}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; add `note_or_dash` using "NA" when `note` is null or empty; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '(. | map(. + {\"note_or_dash\": (if .note == null or .note == \"\" then \"NA\" else .note end)}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `active` is the boolean true; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `name`, `score`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.active == true))) | map({\"id\": .id, \"name\": .name, \"score\": .score}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq "eng"; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `dept`, `profile.city`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"eng\"))) | map({\"id\": .id, \"dept\": .dept, \"profile.city\": .profile.city}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq "sales"; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `dept`, `profile.city`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"sales\"))) | map({\"id\": .id, \"dept\": .dept, \"profile.city\": .profile.city}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq "ops"; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `dept`, `profile.city`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"ops\"))) | map({\"id\": .id, \"dept\": .dept, \"profile.city\": .profile.city}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq ""; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `dept`, `profile.city`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"\"))) | map({\"id\": .id, \"dept\": .dept, \"profile.city\": .profile.city}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 0; then sort by `score` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(((.score | type) == \"number\" and .score >= 0)))) | ((map(select(.score != null)) | sort_by(.score) | group_by(.score) | reverse | add) + map(select(.score == null))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 5; then sort by `score` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(((.score | type) == \"number\" and .score >= 5)))) | ((map(select(.score != null)) | sort_by(.score) | group_by(.score) | reverse | add) + map(select(.score == null))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 8; then sort by `score` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(((.score | type) == \"number\" and .score >= 8)))) | ((map(select(.score != null)) | sort_by(.score) | group_by(.score) | reverse | add) + map(select(.score == null))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `score` gte 12; then sort by `score` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(((.score | type) == \"number\" and .score >= 12)))) | ((map(select(.score != null)) | sort_by(.score) | group_by(.score) | reverse | add) + map(select(.score == null))))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq "eng"; then return the sum of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"eng\"))) | map(select((.score | type) == \"number\") | .score) | add // 0)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq "sales"; then return the sum of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"sales\"))) | map(select((.score | type) == \"number\") | .score) | add // 0)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq "ops"; then return the sum of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"ops\"))) | map(select((.score | type) == \"number\") | .score) | add // 0)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; keep records whose `dept` eq ""; then return the sum of `score`; numeric values ignore nulls and booleans; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(select(.dept == \"\"))) | map(select((.score | type) == \"number\") | .score) | add // 0)' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; sort by `name` asc, leaving null or missing values last; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `name`, `dept`; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | ((map(select(.name != null)) | to_entries | sort_by([.value.name, .key]) | map(.value)) + map(select(.name == null)))) | map({\"id\": .id, \"name\": .name, \"dept\": .dept}))' inputs/data.json"
} |
Read the JSON array in `inputs/data.json`; add `score_scaled` as numeric `score` multiplied by 2 (null when `score` is not numeric); then sort by `score_scaled` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(. + {\"score_scaled\": (if (.score|type)==\"number\" then (if 2 == 0 or .score == 0 then 0 else .score * 2 end) else null end)})) | ((map(select(.score_scaled != null)) | sort_by(.score_scaled) | group_by(.score_scaled) | reverse | add) + map(select(.score_scaled == n... |
Read the JSON array in `inputs/data.json`; add `score_scaled` as numeric `score` multiplied by 3 (null when `score` is not numeric); then sort by `score_scaled` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(. + {\"score_scaled\": (if (.score|type)==\"number\" then (if 3 == 0 or .score == 0 then 0 else .score * 3 end) else null end)})) | ((map(select(.score_scaled != null)) | sort_by(.score_scaled) | group_by(.score_scaled) | reverse | add) + map(select(.score_scaled == n... |
Read the JSON array in `inputs/data.json`; add `score_scaled` as numeric `score` multiplied by 10 (null when `score` is not numeric); then sort by `score_scaled` desc, leaving null or missing values last; write compact JSON. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c '((. | map(. + {\"score_scaled\": (if (.score|type)==\"number\" then (if 10 == 0 or .score == 0 then 0 else .score * 10 end) else null end)})) | ((map(select(.score_scaled != null)) | sort_by(.score_scaled) | group_by(.score_scaled) | reverse | add) + map(select(.score_scaled ==... |
Read the JSON array in `inputs/data.json`; left join `inputs/lookup.json` on left `dept` and lookup `dept`, adding lookup_label, lookup_region, and lookup_budget; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `dept`, `lookup_label`, `lookup_region`; write compact JSO... | {
"kind": "COMMAND",
"value": "jq -c --slurpfile lookup inputs/lookup.json '((. | (($lookup | if length == 1 and (.[0]|type)==\"array\" then .[0] else . end) as $L | map(. as $left | ($L | map(select(.dept == ($left | .dept))) | .[0]) as $m | if ($m == null and \"left\" == \"inner\") then empty elif $m == null then... |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq "eng"; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '(. | map(select(.dept == \"eng\")))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq "sales"; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '(. | map(select(.dept == \"sales\")))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq "ops"; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '(. | map(select(.dept == \"ops\")))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq ""; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '(. | map(select(.dept == \"\")))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `note` is neither null nor empty; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `name`, `note`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select((.note != null and .note != \"\" and .note != [] and .note != {})))) | map({\"id\": .id, \"name\": .name, \"note\": .note}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `profile.city` eq "Paris"; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `profile.city`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.profile.city == \"Paris\"))) | map({\"id\": .id, \"profile.city\": .profile.city}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `profile.city` eq "Oslo"; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `profile.city`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.profile.city == \"Oslo\"))) | map({\"id\": .id, \"profile.city\": .profile.city}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `profile.city` eq null; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `profile.city`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.profile.city == null))) | map({\"id\": .id, \"profile.city\": .profile.city}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `profile.city` eq "Berlin"; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `profile.city`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.profile.city == \"Berlin\"))) | map({\"id\": .id, \"profile.city\": .profile.city}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; sort by `id` asc, leaving null or missing values last; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `name`, `score`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | ((map(select(.id != null)) | to_entries | sort_by([.value.id, .key]) | map(.value)) + map(select(.id == null)))) | map({\"id\": .id, \"name\": .name, \"score\": .score}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; sort by `score` desc, leaving null or missing values last; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `score`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | ((map(select(.score != null)) | sort_by(.score) | group_by(.score) | reverse | add) + map(select(.score == null)))) | map({\"id\": .id, \"score\": .score}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; retain the first record for each distinct `dept` value; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `dept`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | reduce .[] as $row ([]; if any(.[]; .dept == ($row | .dept)) then . else . + [$row] end)) | map({\"id\": .id, \"dept\": .dept}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; return the avg of `score`; numeric values ignore nulls and booleans; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '(. | map(select((.score | type) == \"number\") | .score) as $n | if ($n|length)==0 then null else ($n|add)/($n|length) end)' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq "eng"; then count records whose `score` is present and non-null; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.dept == \"eng\"))) | map(select(.score != null)) | length)' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq "sales"; then count records whose `score` is present and non-null; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.dept == \"sales\"))) | map(select(.score != null)) | length)' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq "ops"; then count records whose `score` is present and non-null; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.dept == \"ops\"))) | map(select(.score != null)) | length)' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `dept` eq ""; then count records whose `score` is present and non-null; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select(.dept == \"\"))) | map(select(.score != null)) | length)' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; add `note_or_dash` using "-" when `note` is null or empty; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `note_or_dash`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(. + {\"note_or_dash\": (if .note == null or .note == \"\" then \"-\" else .note end)})) | map({\"id\": .id, \"note_or_dash\": .note_or_dash}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; add `note_or_dash` using "unknown" when `note` is null or empty; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `note_or_dash`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(. + {\"note_or_dash\": (if .note == null or .note == \"\" then \"unknown\" else .note end)})) | map({\"id\": .id, \"note_or_dash\": .note_or_dash}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; add `note_or_dash` using "NA" when `note` is null or empty; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `note_or_dash`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(. + {\"note_or_dash\": (if .note == null or .note == \"\" then \"NA\" else .note end)})) | map({\"id\": .id, \"note_or_dash\": .note_or_dash}))[]' inputs/data.jsonl"
} |
Read the JSON Lines stream in `inputs/data.jsonl`; left join `inputs/lookup.jsonl` on left `dept` and lookup `dept`, adding lookup_label, lookup_region, and lookup_budget; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `dept`, `lookup_label`; write compact JSONL. Keep... | {
"kind": "COMMAND",
"value": "jq -c --slurpfile lookup inputs/lookup.jsonl -s '((. | (($lookup | if length == 1 and (.[0]|type)==\"array\" then .[0] else . end) as $L | map(. as $left | ($L | map(select(.dept == ($left | .dept))) | .[0]) as $m | if ($m == null and \"left\" == \"inner\") then empty elif $m == null ... |
Read the JSON Lines stream in `inputs/data.jsonl`; keep records whose `tags` contains "ops"; then retain exactly these fields under their literal output keys (dotted paths stay dotted): `id`, `tags`; write compact JSONL. Keep nulls and empty strings distinct. | {
"kind": "COMMAND",
"value": "jq -c -s '((. | map(select((((.tags | type) == \"array\" and (.tags | index(\"ops\")) != null) or ((.tags | type) == \"string\" and (.tags | contains(\"ops\"))))))) | map({\"id\": .id, \"tags\": .tags}))[]' inputs/data.jsonl"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.