jqPlay snippets collected using google and github
https://jqplay.org/s/8Zrwy7dDxW
map (select (.| length > 9 ))
https://jqplay.org/s/Jb_fnBveMQ
with_entries (.value |= .ip )
https://jqplay.org/s/O76mi-VYRs
https://jqplay.org/s/dx5rA2kfbg
if . [].username == "root" then . [].password else "" end
https://jqplay.org/s/seNL7hW38W
https://jqplay.org/s/JJ2fqpEHib
.requestReports | reduce . [] as $item (0 ; . + ($item .total | tonumber ))
https://jqplay.org/s/lkXItbZCHZ
.dictionary | map (select (.examples | length > 0 ))
https://jqplay.org/s/-UgbEC4BN8
fromstream ([ [ "foo" , "a" ], 1 ],[ [ "foo" , "b" ], 2 ],[ [ "foo" , "b" ] ],[["foo" ]],[ [ "bar" , "a" ], 1 ],[ [ "bar" , "b" ], 2 ],[ [ "bar" , "b" ] ],[ [ "bar" ] ]) | with_entries (.value += {key }) | . []
https://jqplay.org/s/k90JFcDqPz
https://jqplay.org/s/JGIX6hTt_8
https://jqplay.org/s/tblW7UX0Si
.subs [] | select (.name = "aaa" ) | .subs [] | select (.name = "bbb" ) | .subs [] | select (.name = "ccc" ) | .subs [] | .payload
https://jqplay.org/s/u3_pDNyYfD
https://jqplay.org/s/Y9UgK_4xxE
https://jqplay.org/s/A-coPyznVo
.list [] | {a , e } | select (.a == "b" )
https://jqplay.org/s/B677bZSVWa
.results [] | select ( .types [] | contains ("restaurant" ) ) | select ( .opening_hours.open_now )
https://jqplay.org/s/6HRvEND8AB
https://jqplay.org/s/5BJsU3pyPM
del (.. | .publicAccess ? , .userGroupAccesses ? )
https://jqplay.org/s/Eo6h_3V8PO
reduce (tostream | select (length == 2 )) as $i ({}; . [[$i [0 ][]| tostring ]| join ("_" )] = $i [1 ] )
https://jqplay.org/s/_5KiPRS75r
https://jqplay.org/s/risDCfxm5j
. | ( ("secrets" ,"toto" ,"test" ) as $k | (if index ($k ) | not then (. + {"$k" :$k } ) else empty end ))
https://jqplay.org/s/jFY3N2vXJ3
https://jqplay.org/s/qqbHfBT0h5
"2019-05-23T02:00:06Z" as $arg | map (select (.time < $arg )) | max_by (.time )
https://jqplay.org/s/9TqdXbe0lo
https://jqplay.org/s/Z5qjhJnRyn
https://jqplay.org/s/L5bu1ovLr-
https://jqplay.org/s/BjgdGsjPem
https://jqplay.org/s/Tn7NUbP4Dr
https://jqplay.org/s/LYflwM4kJM
https://jqplay.org/s/y8WwvHISH4
map (if . == 0 then "zero" elif . == 1 then "one" elif . == 2 then "two" else "many" end )
https://jqplay.org/s/KhRuUFCP2h
https://jqplay.org/s/ae0RTNbTiY
https://jqplay.org/s/ufUZAtLeHn
[contains ("x" ), contains ("x\u0000 " ), contains ("x\u0000 y" ), contains ("y" )]
https://jqplay.org/s/HRWV44YgUp
[ . [] | select (.values.timestamp ? ) ]
https://jqplay.org/s/ncoCnMU6WW
.groups | to_entries | map ( {(.value []): {(.key ):null } }) | reduce . [] as $item ({}; . * $item ) | to_entries | map ({key :.key , value :(.value | keys )}) | from_entries
https://jqplay.org/s/02CPHO1ESj
https://jqplay.org/s/uHqfdPoF3e
[ to_entries [] | .value = .value.value ] | from_entries
https://jqplay.org/s/zkBQG8vTN8
https://jqplay.org/s/1m7wAeHMTu
def walk (f ): . as $in | if type == "object" then reduce keys [] as $key ( {}; . + { ($key ): ($in [$key ] | walk (f )) } ) | f elif type == "array" then map ( walk (f ) ) | f else f end ; walk (if (type == "object" and .publicAccess ) then del (.publicAccess ) elif (type == "array" and .userGroupAccesses ) then del (.userGroupAccesses ) else . end )
https://jqplay.org/s/RbKiioures
[. [] | select (.key3 == true ) |= {"key1" : ("updated_" + .key1 ), "key2" : (.key2 * 2 ), "key2a" : ("updated_" + (.key2 | tostring )), "key3" : .key3 }]
https://jqplay.org/s/3VpRc5l4_m
map_values ( reduce group_by (.role )[] as $g ({}; . [$g [0 ].role ].hosts = [$g [] | del (.hostname , .role )[]] ) )
https://jqplay.org/s/2mY6yus7Mz
map ( with_entries (select (.key != "fields" )) + (.fields | with_entries (.value = (.value | join ("," )))) )
https://jqplay.org/s/plpHDzbjnW
# Apply f to composite entities recursively, and to atoms def walk(f): . as $in | if type == "object" then reduce keys[] as $key ( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f elif type == "array" then map( walk(f) ) | f else f end; def normalize: walk(if type == "array" then sort_by(.name) else . end); normalize
https://jqplay.org/s/AVpz_IkfJa
.content.data | del ( .hits [].doc.notes [] | select ( .types | any (startswith ("x" ) or startswith ("y" )) | not ) )
https://jqplay.org/s/G7GxNYYqY1
if . [].username == "root" then . [].password else "" fi
https://jqplay.org/s/N9b0fanbyh
{DesktopEntry : . } | .DesktopEntry |= split ("\n " ) | . [] |= reduce (. [] | split ("=" )) as [$key , $value ] ({}; . [$key ] = $value )
https://jqplay.org/s/nwxNZ7LOY6
https://jqplay.org/s/5Uc6-Lkxpv
reduce (.items [] | select (.charge == null )) as $i (0 ;.+= 1 )
https://jqplay.org/s/L-Rnd1C6yv
.items [] | select (.charge == null ) | .id
https://jqplay.org/s/qpx5knqiPt
def walk (f ): . as $in | if type == "object" then reduce keys [] as $key ( {}; . + { ($key ): ($in [$key ] | walk (f )) } ) | f elif type == "array" then map ( walk (f ) ) | f else f end ; walk (if type == "object" then del (.publicAccess , .userGroupAccesses ) else . end )
https://jqplay.org/s/X5MI2D4YrH
. + {two :"newtwo" , three :"newthree" }
https://jqplay.org/s/srPWnELEiS
. [] | "curl -s -o output/\( .name ) \( .extension ) \( .url ) "
https://jqplay.org/s/mwBhsYud2F
map (select (.letters // []| ((contains (["a" ]) or contains (["b" ])) and (contains (["a" , "b" ])| not ))))
https://jqplay.org/s/phmy8taWCu
"youtube.com/watch?v=\( .videos [].video_id ) "
https://jqplay.org/s/WaQEdx99mp
.data | map ({id : .id , q : .pages [].questions []}) | map ({id : .id , q : .q.heading , a : .q.answers [0 ].simple_text })
https://jqplay.org/s/Bi3FbRMi7 _
. [0 ].windows []? | map (.url )? | sort
https://jqplay.org/s/DqbLesXlCP
https://jqplay.org/s/xLb30v0X5T
. [].info [] |= {(.key ):.value , (.keyCaption ):.valueCaption }
https://jqplay.org/s/LRHW9BaX42
[.mine [] as $in | .stuff [$in ].name ]
https://jqplay.org/s/FPBiC8xt3p
group_by (.org , .rc . "$event" )[] | [. [0 ].rc . "$event" , . [0 ].org , length ] | @tsv
https://jqplay.org/s/0aVbFzMttK
.+ {"headers" : {}} and .shoporders [] + {"ext_ad_info_mappings" : []} and .payment_channel_info.grouping_info.groups [].display_info + {"enabled" : true }
https://jqplay.org/s/2uk_Z_sjug
https://jqplay.org/s/QJz5FCmuc9
. [] | [.time , .descendantcount , .ancestorcount ] | @csv
https://jqplay.org/s/XfDUheaXFB
.items [] | select (.name == "thing-3" ) | .
https://jqplay.org/s/ugF5foO90N
.headers = {} | .shoporders [].ext_ad_info_mappings = [] | .payment_channel_info.grouping_info.groups [].display_info.enabled = true
https://jqplay.org/s/cLAeCsoIY9
getpath ( paths (has ("class" )? ) ) | [.class ,.score ] | @csv
https://jqplay.org/s/3WctRQDHhg
https://jqplay.org/s/vilCNy-iTD
https://jqplay.org/s/aWWN_xVzpD
(.TagSet [] | select (.Key == "key1" )).Value = "foo"
https://jqplay.org/s/33L3zA9Fos
.service |= [. , .name = "tomcat" ]
https://jqplay.org/s/RTepHq7GC-
https://jqplay.org/s/kF2SWNRv84
. [] | select (.id == "3" or .id == "2" ) | .name ,.value
https://jqplay.org/s/k747PBLh4T
reduce . [] as $s (0 ; if $s .spam_score > 40 then .+ 1 else . end )
https://jqplay.org/s/tSkYQN5xF-
path (.cells [] | select (.foo [0 ] == "# BAR\n " ))
https://jqplay.org/s/-3HVKchyfi
with_entries (.value |= @sh ) | to_entries [] | "\( .key ) =\( .value ) "
https://jqplay.org/s/8bNKn7d-fu
https://jqplay.org/s/QzOttRHoz1
foreach .Names [] as $name ([];[];$name | [.Name , .Age ])
https://jqplay.org/s/M_RpdNHvHF
https://jqplay.org/s/9a_OBo6FlE
[leaf_paths as $path | {"key" : $path | join ("_" ), "value" : getpath ($path )}] | from_entries
https://jqplay.org/s/y6YWdlXfl8
setpath (path (.TagSet [] | select (.Key == "key1" ) | .Value ); "foo" )
https://jqplay.org/s/mIRTvuLNDn
[ .links [] | select (.active == true ) | { created : (.created | todate ), title , url } ]
https://jqplay.org/s/TNq7c5ctot
[.all_commit_details [].subject | scan ("([A-Z]{2,30}-[0-9]+)" ) | . [] ]
https://jqplay.org/s/qVZKGt92FM
https://jqplay.org/s/QA0f2qEE4S
.name as $p | .children [] | [$p , (recurse (.children []) | .name )] | join ("/" )
https://jqplay.org/s/ktL3ZhscMh
{ "foo" : .foo.bar , "sub" : .foo.baz | tostring }
https://jqplay.org/s/OHGD3RHk1f
match ("(?<p>\\ ()?[^()]+(?(p)\\ ))?" )
https://jqplay.org/s/fOBuwdj6WS
if . [].name | type == "array" then . [].name [0 ]? else first (. [].name ) end
https://jqplay.org/s/VctBNl2TYN
.properties | .maxTemperature.values [].value ,.minTemperature.values [].value ,.weather.values [].value [].weather
https://jqplay.org/s/D5-FZl8wOs
to_entries [] | {hash : .key , val : .value []} | [.hash , .val.i , .val.p , .val.l ]
https://jqplay.org/s/X9nYQDDGbG
{ "@name" : .site . "@name" , "@ssl" : .site . "@ssl" , "alerts" : [.site.alerts [] as $in | $in .instances [] as $h | $in | del (.instances ) as $in2 | $h * $in2 ]}
https://jqplay.org/s/578mkUAklU
(.TaskGroups [] | select (.Name == ("test1" , "test5" )).Count ) |= 0 | {Job : . }
https://jqplay.org/s/ZIFU5gBnZ7
([.titles ,.years ]| transpose []) as [$title ,$year ] | {user ,$title ,$year }
https://jqplay.org/s/vQ1_Psl1LI
. []| [.from ? ,.date ,.text ]| @csv
https://jqplay.org/s/N-M-QiVCq4
.newList [] | "\( .id ) \( .create.date ) "
https://jqplay.org/s/UwHkeiH9NG
[keys [] as $k | {($k ):. [$k ]} | tojson [1 :- 1 ]] | join ("," )
https://jqplay.org/s/ggmuK5WvZF
https://jqplay.org/s/0hYw08MN1C
https://jqplay.org/s/xGA99WWoKT
.builders += [.builders [0 ] | .name = "production" ]
https://jqplay.org/s/AhaMCazi9o
.links . "urn:somedomainid:follow" .href
https://jqplay.org/s/LU5_ewGqga
https://jqplay.org/s/nQubEJotBR
https://jqplay.org/s/xClPHmIsTZ
[ to_entries [] | { "name" : .key , "count" : [ .value | to_entries [] | { "type" : .key , "number" : .value } ]}]
https://jqplay.org/s/duCj0FrEAt
https://jqplay.org/s/CR8mGBX8Dz
[.root [] | {field1 , field2 , field3Array : .field3Array [].prop1 }]
https://jqplay.org/s/e8ZHP1t_K3
def pad (n ):"\( . ) " | (split ("." )+ ["0" ])[:2 ]|. [1 ]|= (.+ "0" * n )[:n ]| join ("." ); "\( .lat | pad (9 )) \( .lon | pad (9 )) "
https://jqplay.org/s/6bxD-Wq0QE
.data.search.edges [].node | {name , topics : .. | .topics ? | map (select (. != null ) | flatten }
https://jqplay.org/s/YP1oGSTgge
.results [] | select ( .types [] | contains ("restaurant" ) ) | .name
https://jqplay.org/s/gHGkdx8nJR
reduce leaf_paths as $p (. ; if $p [- 2 ]== "agents" and getpath ($p )== "agent4" then delpaths ([$p ]) else . end )
https://jqplay.org/s/LtXR8qfo6D
.prefixes [] | select (.region == "ap-northeast-1" or .region == "ap-northeast-3" ) | select (.service == "EC2" ) | .ip_prefix
https://jqplay.org/s/CpDPlGueMM
[. [].assets | . [].download_count ] | add
https://jqplay.org/s/gwvMIH_fed
{"apiId" : .value [].id , "metrics" : .value [].name.value , "timestamp" : .value [].timeseries [].data [].timeStamp , "value" : .value [].timeseries [].data [].average }
https://jqplay.org/s/KxQS_Rx0rL
{ retracted : (. "update-to" [0 ].type == "retraction" ), update : { timestamp : . "update-to" [0 ].updated.timestamp , doi : .DOI , type : . "update-to" [0 ].type }, doi : . "update-to" [0 ].DOI , journal : . "container-title" [0 ], publisher : .publisher , title : .title [0 ] }
https://jqplay.org/s/KzNXa7NqKq
. += [{"severity" : "Severity" ,"name" : "Name" ,"files" : "Files" ,"id" : "0" }, {"severity" : "--------" ,"name" : "------------------------------------" ,"files" : "--------" ,"id" : "01" }] | sort_by (.id ) | . [] | ["| " + .severity , "| " + .name , "| " + (.files | join ("," )) , "| " ]
https://jqplay.org/s/XjqqNuINeZ
https://jqplay.org/s/ger1zb3_xV
https://jqplay.org/s/sxussfa2Vj
.objectEntries | {tickets : map (.attributes | {ticketID : (reduce . [] as $r (null ; if $r .objectTypeAttributeId == 328 then $r .objectAttributeValues [0 ].value else . end )),date : (reduce . [] as $r (null ; if $r .objectTypeAttributeId == 330 then $r .objectAttributeValues [0 ].value else . end )), hostnames : (reduce . [] as $r ([]; if $r .objectTypeAttributeId == 329 then $r .objectAttributeValues | map (.value ) else . end ))})}
https://jqplay.org/s/59vZhMXYbe
["\( 1 + range (5 )) " ] as $units | ["Action" , "Group" , "Unit\( $units []) " ], (inputs | .Action as $a | (.Group // [{Id :"0" , Units :[]}])[] | [$a , .Id , (.Units [$units []| [. ]] | if .!= [] then "1" else "0" end ) ] ) | join ("|" )
https://jqplay.org/s/_BAt2M6bkZ
.results [] | select ( .types [] | contains ("restaurant" ) )
https://jqplay.org/s/GpVJfbTO-Q
. as $root | .source + { items : [.source.items [] | select (.id as $id | $root .update.toRemove | contains ([$id ]) | not )]}
https://jqplay.org/s/itgHiQlNMP
https://jqplay.org/s/CzPU5im0RE
map (select (.finalStatus != null ))
https://jqplay.org/s/Od6lj5qjwm
[ .. | .types ? | arrays ] | flatten | unique
https://jqplay.org/s/xX_wUM-o5W
[ .links [] | select (.active == true ) ]
https://jqplay.org/s/izjjHkDpdG
.limit , .offset , (.values [] | .id , .type , .users.total , .users.profiles [].first_name , .users.profiles [].last_name )
https://jqplay.org/s/onlU9ghjn1
.gcp_price_list | . "CP-COMPUTEENGINE-OS" | ( if ( . [].cores == "shared" ) then . [].cores = 0.5 else . [].cores = . [].cores end )
https://jqplay.org/s/bgiJvPKryC
[. [] | {id : .identifier , title : .title , downloads : [.other_download [].access_url ? ][0 ], website : .website , description : .description.en , triples : .triples , domain : .domain ? , example : .example [].access_url ? , sparql : .sparql [].access_url ? , namespace : .namespace ? } ]
https://jqplay.org/s/xjND6Iv60T
https://jqplay.org/s/7JSSbYF32N
sort_by (.timestamp ) | map (select (.result.Code == 0 )) | map (select (.tx.value.msg [0 ].value.dst_owner == "faa14sk203d2akh96gdlhveglw5emfpf0h8xqls3l0" )) | . [].tx.value.msg [0 ].value.src_owner
https://jqplay.org/s/x3IArefkyH
https://jqplay.org/s/cgwBLk3dxa
[.result [].id ]| unique | . [] | "* [[TreeNodeKind/" + . + "]]"
https://jqplay.org/s/n7WjphEVf7
select (.some.more.depth == "here" ) | tee .version | .some.more.depth
https://jqplay.org/s/yYrdjEEhIm
. [].urls [] | select (.url == "pixiv" ) json
https://jqplay.org/s/aUTncmciuj
def row ($i ; $padding ): . as $in | [range (0 ;$padding ) | null ] as $nulls | reduce range (0 ; length ) as $ix ([]; . + ($in [$ix ][1 ][$i ] // $nulls )); | (map (. [1 ] | length ) | max ) as $rows | range (0 ; $rows ) as $r | row ($r ; 4 ) | @tsv
https://jqplay.org/s/npoAQkfK9V
.gcp_price_list | [. [keys [] | select (contains ("VMIMAGE" ))]]
https://jqplay.org/s/svMcFCRZ31
. [] | select (.Names [] | contains ("_db_" )) | select (.State == "running" ) | .Status | contains ("healthy" )
https://jqplay.org/s/QOs3d_fMLU
(map (keys ) | add | unique ) as $cols | map (. as $row | $cols | map ($row [. ])) as $rows | $cols , $rows [] | @csv
https://jqplay.org/s/GgXZg67o79
{"id" : .id , "name" : .tags []| select (.Key == "Name" ).Value }
https://jqplay.org/s/1D40LxXtKF
.results [] | select ( .types [] | contains ("restaurant" ) ) | [.name , (.types | join (", " ))? ] | join (": " )
https://jqplay.org/s/YqGkGYKaeI
https://jqplay.org/s/EH9aWjmNR4
now | todate ,now ,now | todate
https://jqplay.org/s/0IfiBoskG5
reduce (.issues | to_entries []) as {$key ,$value } ({}; . ["JIRA-\( $key + 1 ) " ] = $value .key )
https://jqplay.org/s/VvdATQ6bAr
.cluster.collections | select (.myApp.shards.shard1.replicas [].node_name == "1.2.3.46:8983_emo" )
https://jqplay.org/s/_O6MtY3FlH
https://jqplay.org/s/CAMSFmpe3W
.items [] | .node + " " + .result.stdout
https://jqplay.org/s/mrq5-WqKip
tostream | select (length == 2 ) | . [0 ] |= map (strings ) | flatten | join ("/" )
https://jqplay.org/s/szc4FvPq7C
[. []| {id :.children [0 ].text ,cat1 :.children [1 ].children [0 ].text ,cat2 :.children [1 ].children [2 ].text ,titolo :.children [2 ].text ,dataInizio :(.children [3 ].text | split (" " ))[0 ]| strptime ("%d/%m/%Y" ) | strftime ("%a, %d %b %Y 02:00:00 +0200" ),dataFine :(.children [3 ].text | split (" " ))[1 ]| strptime ("%d/%m/%Y" ) | strftime ("%a, %d %b %Y 02:00:00 +0200" )}]
https://jqplay.org/s/6DsIxWBa1L
https://jqplay.org/s/QfPXOe20Ex
sort_by (.timestamp ) | map (select (.result.Code == 0 )) | map (select (.tx.value.msg [0 ].value.coins [0 ].denom != "iris-atto" )) | . [].tx.value.msg [0 ].value.owner
https://jqplay.org/s/GWn_IEuyAy
sort_by (.timestamp ) | map (select (.result.Code == 0 )) | . [].tx.value.msg [0 ].value.owner
https://jqplay.org/s/BaI4jtzmUf
https://jqplay.org/s/-EfBYL8JPn
.policy.sites.trusted [] | sub ("§:" ;"" ) | "* \( . ) * noop"
https://jqplay.org/s/9UcLXKEgaT
https://jqplay.org/s/sccwJi75jb
https://jqplay.org/s/s1GiNkp_Ed
https://jqplay.org/s/1ckAfiLKA3
https://jqplay.org/s/_7uGMWvmUh
https://jqplay.org/s/mL-eA6ZJlI
map (select (.country == "Canada" ))
https://jqplay.org/s/zg_l3ZoT6C
.databases | map ({db : .name , user : .users [].username })
https://jqplay.org/s/eRBisoYbDb
.regions | [to_entries [] | {"key" : .value.displayName , "value" : .value.slug }]| from_entries
https://jqplay.org/s/cFmrjydbkC
.regions | [to_entries [] | {"key" : .value.displayName , "value" : .value.slug }]| from_entries
https://jqplay.org/s/8Hd1vD-PmF
[ . [][0 ] | select (.region != null ) | { "location" : .location , "region" : .region } ] | unique
https://jqplay.org/s/dtvjDF6QKj
.gcp_price_list | . |= with_entries ( select ( .key | contains ("INTERNET" ) ) )
https://jqplay.org/s/Gvh3qis9pj
.gcp_price_list | . |= with_entries ( select ( .key | contains ("INTERNET" ) ) )
https://jqplay.org/s/1PlNwqyVhC
capture ("\\\\ (?<key>[a-z]+) (?<value>.*)" )
https://jqplay.org/s/eOI_lLytRP
.offers.transactions.prices
https://jqplay.org/s/NbdTDztQbb
.offers | del ( .transactions )
https://jqplay.org/s/D3L0oGVSq3
https://jqplay.org/s/usBT4XfMaE
walk (if type == "string" then gsub ("\\ p{Cc}" ; " " ) else . end ) | [.level ,.content , .logger_name ]
https://jqplay.org/s/uqwmmsbkvi
[.level , (.content | gsub ("[\\ p{Cc}]" ; " " )[0 :20 ] ),.logger_name ]
https://jqplay.org/s/tt302_aTzV
.gcp_price_list | . |= with_entries ( select ( .key | contains ("CP-COMPUTEENGIN" ) and ( contains ("PD" ) or contains ("SSD" ) ) ) ) | [ to_entries [] | { "name" : .key , "prices" : [ .value | to_entries [] | { "region" : .key , "price" : .value } ] } ]
https://jqplay.org/s/i8blbKEmeC
.gcp_price_list | . |= with_entries ( select ( .key | contains ("CP-COMPUTEENGIN" ) and ( contains ("PD" ) or contains ("SSD" ) ) and (contains ("IO-REQUEST" ) | not ) ) ) | [ to_entries [] | { "name" : .key , "prices" : [ .value | to_entries [] | { "region" : .key , "price" : .value } ] } ]
https://jqplay.org/s/iy0C1YR1Hq
.gcp_price_list | . |= with_entries (select (.key | contains ("VMIMAGE" ) )) | [ to_entries [] | { "name" : .key , "cores" :( if (.key | contains ("F1-MICRO" )) then 0.2 elif (.key | contains ("G1-SMALL" )) then 0.5 else .value.cores end ), "memory" : .value.memory , "gceu" : ( if .value.gceu == "Shared CPU, not guaranteed" then null else .value.gceu end ), "maxNumberOfPd" : .value.maxNumberOfPd , "maxPdSize" : .value.maxPdSize , "price" : [ .value | del ( .cores , .memory , .gceu , .fixed , .maxNumberOfPd , .maxPdSize , .ssd ) | to_entries [] | { "region" : .key , "price" : .value } ] } ]
https://jqplay.org/s/8bvhcfLZV4
.gcp_price_list | . |= with_entries (select (.key | contains ("VMIMAGE" ) )) | [ to_entries [] | { "name" : .key , "cores" :( if (.key | contains ("F1-MICRO" )) then 0.2 elif (.key | contains ("G1-SMALL" )) then 0.5 else .value.cores end ), "memory" : .value.memory , "gceu" : ( if .value.gceu == "Shared CPU, not guaranteed" then null else .value.gceu end ), "maxNumberOfPd" : .value.maxNumberOfPd , "maxPdSize" : .value.maxPdSize , "price" : [ .value | del ( .cores , .memory , .gceu , .fixed , .maxNumberOfPd , .maxPdSize , .ssd ) | to_entries [] | { "region" : .key , "price" : .value } ] } ]
https://jqplay.org/s/Rog9ZugjW-
. []| [.id , .name ,.description ,.namespace ,.statistics.commit_count , .statistics.repository_size ]
https://jqplay.org/s/lOf6--Qfwu
https://jqplay.org/s/IrbiQWTZbQ
def set (s ): reduce s as $x ({}; . [$x | (type [0 :1 ] + tostring )] = $x ); def distinct (s ): set (s )[]; .gcp_price_list | del (.sustained_use_base ,.sustained_use_tiers ) | [ distinct (. [] | keys_unsorted [] as $k | select ( getpath ([$k ]) | type == "number" ) | $k ) ] - ["maxNumberOfPd" , "maxPdSize" , "gceu" ]
https://jqplay.org/s/6TqXSWl_0w
def set (s ): reduce s as $x ({}; . [$x | (type [0 :1 ] + tostring )] = $x ); def distinct (s ): set (s )[]; .gcp_price_list | del (.sustained_use_base ,.sustained_use_tiers ) | [ distinct (. [] | keys_unsorted [] as $k | select ( getpath ([$k ]) | type == "number" ) | $k ) ] - ["maxNumberOfPd" , "maxPdSize" , "gceu" ]
https://jqplay.org/s/yP8J1oVhfs
.gcp_price_list.NETWORK_LOAD_BALANCED_INGRESS
https://jqplay.org/s/_hy6zyaSBd
.gcp_price_list.NETWORK_LOAD_BALANCED_INGRESS
https://jqplay.org/s/1Ugkd8zB3B
.gcp_price_list | . |= with_entries ( select ( .key | contains ("RULE" ) ) )
https://jqplay.org/s/95EyhhroA9
.gcp_price_list | . |= with_entries ( select ( .key | contains ("RULE" ) ) )
https://jqplay.org/s/M5Ky1KJd-C
.store.book [] | select (.category == "reference" ) | .author
https://jqplay.org/s/rDPhRVFSsj
. [] | [.id , .short_id ,.parent_ids ,.title ,.message ]
https://jqplay.org/s/dWeikiBJKj
capture ("^#{2,} (?<value>[A-Z]+): " )
https://jqplay.org/s/hGLDkMm3-M
.results [] | select ( .types [] | contains ("restaurant" ) ) | select ( .opening_hours.open_now ) | .name
https://jqplay.org/s/OrtlyrkIyg
https://jqplay.org/s/DljtxNX_72
select ((.properties.id | tonumber ) != .properties.recipient.id )
https://jqplay.org/s/4GNwRCpQLX
foreach . [] as $item (0 ; . + 1 ; "\( . ) - \( $item ) " )
https://jqplay.org/s/LY8so0wxbk
.selectedUser += {"profile" : "aabc1f631b274fea85fabec6c3487ee1" }
https://jqplay.org/s/tnH4k6BS6i
.. | select (.focus ? ) as $root | .. | select (.focused ? ) | "\( .name ) \( $root .layout ) "
https://jqplay.org/s/BusOB8PMQ2
[.result [].id ]| unique | . [] | "* [[TreeDumpIndex/" + . + "]]"
https://jqplay.org/s/itc9Xo1HIt
[.result [].id ]| unique | . [] | "* [[TreeCodeClass/" + . + "]]"
https://jqplay.org/s/1nkuX_LRiU
[.result [].id ]| unique | . [] | "* [[TreeCodeClass/" + . + "]]"
https://jqplay.org/s/f8Ij7g73IG
[.result [].id ]| unique | . [] | "* [[TreeCodeClass/" + . + "]]"
https://jqplay.org/s/2sm1pKQ2fS
first (select (.updated_at == "2019-06-03T16:36:53.194Z" ))
https://jqplay.org/s/DeSANQZtj7
nth (1 ; select (.updated_at == "2019-06-03T16:36:53.194Z" ))
https://jqplay.org/s/nYlPohfTdZ
.response.data.sessions [0 ].user
https://jqplay.org/s/Cw-nbWwmjz
select (.requested_reviewers | length > 0 )
https://jqplay.org/s/n5jsRsPMhW
[ . [] | select (.values | has ("timestamp" )? ) ]
https://jqplay.org/s/KLPXwB7Ey _
. [].item1 as $item | $item .array1 [] | $item .item2 , .item3 , .item4
https://jqplay.org/s/g_8HgqiQ1o
[inputs .host / "-" | last ]| group_by (. )[]| "\( . [0 ]) -> \( length ) "
https://jqplay.org/s/S2oeLfMRNR
reduce (inputs .host / "-" | last ) as $k ({}; . [$k ] += 1 )| to_entries []| "\( .key ) -> \( .value ) "
https://jqplay.org/s/ypiYcNBa-I
.endpoints |= map ((.virtual_endpoint | sub ("https?://[^/]+" ; "" )) as $end_p | .vs_endpoints |= [. [] | . + $end_p ] )
https://jqplay.org/s/xjMiqANQ3p
.versions [].columns |= map (if (.type == "varchar" and .length < 255 ) then .length = 255 else . end )
https://jqplay.org/s/zL6HpSSFw0
. [] | [.urlString , .imageUrl ] | @csv
https://jqplay.org/s/6zMyKjTehN
map (select (.product.type == "mobile" )) | . [] | {id : .product.id , service : .product.service }
https://jqplay.org/s/_0CFADWu2G
.remote | group_by (.name ) | map ({ (. [0 ].name ): map (.id ) }) | add
https://jqplay.org/s/OTbaGREIUH
to_entries | sort_by (.value ) | reverse | from_entries
https://jqplay.org/s/Q81EZahkjG
foreach tostream as $pv ([[],[]]; if ($pv | length ) == 2 then (. [0 ] |= if . == [] then . + [$pv [0 ][0 ],$pv [1 ]] else . + [$pv [1 ]] end ) else [[],. [0 ]] end ; if . [0 ] == [] and . [1 ] != [] then . [1 ] else empty end )
https://jqplay.org/s/VeGHuouLRY
. [] as $x | { price : ($x .price * - 1 ) }
https://jqplay.org/s/y6AFKg2dSM
reduce (.issues | to_entries []) as {$key ,$value } ({}; . ["JIRA-\( $key + 1 ) " ] = $value .key )
https://jqplay.org/s/H2uxyFJn9E
.issues | with_entries ({key : "JIRA-\( .key + 1 ) " , value : .value.key })
https://jqplay.org/s/Xp64LfJFBc
https://jqplay.org/s/ZGj1wC8hU3
reduce ([inputs [][]] | group_by (.role )[]) as $g ({}; . [$g [0 ].role ].hosts = ([$g [] | del (.hostname , .role )[]] | unique ) )
https://jqplay.org/s/-sZ7tvU4Yb
.datasets [].features [].stringStats // empty
https://jqplay.org/s/54OH83qHKP
.data.result [] | if .metric.pod | contains ("dev-cds" ) then . else empty end
https://jqplay.org/s/fwjTN1CnFc
{a : .a }, (.list | map ({(.Key ): .Value }) | add )
https://jqplay.org/s/n1kf-19yFT
.data.devices | to_entries | map ({key , value : {ip : .value.ip , otherInformation : .value.otherInformation }}) | from_entries
https://jqplay.org/s/zLsEYAQrFC
(.microservices [] | select (.appId == "builds" )).volumesFrom = ["foo" ,"bar" ]
https://jqplay.org/s/de4X1TUBG4
https://jqplay.org/s/iaSIPnkxFm
. [].Checks [1 ].ServiceTags
https://jqplay.org/s/ea-LyKhhpy
https://jqplay.org/s/NAhuXNYXXO
. as $original | . [] | select (.Id == "ghi" ) | [.Dependencies []] as $level1Dep | [$original [] | select ( [ .Id == $level1Dep [] ] | any )] as $level1Full | $level1Full [] | [.Dependencies []] as $level2Dep | [$original [] | select ( [ .Id == $level2Dep [] ] | any )] as $level2Full | [$level1Dep [], $level2Dep []]
https://jqplay.org/s/Zs0xIvJ2Zn
. as $original | . [] | select (.Id == "jkl" ) | [.Dependencies []] as $level1Dep | [$original [] | select ( [ .Id == $level1Dep [] ] | any )] as $level1Full | $level1Full [] | [.Dependencies []] as $level2Dep | [$original [] | select ( [ .Id == $level2Dep [] ] | any )] as $level2Full | [$level1Dep [], $level2Dep []]
https://jqplay.org/s/eB9zHQSH2r
. as $original | . [] | select (.Id == "ghi" ) | [.Dependencies []] as $level1Dep | [$original [] | select ( [ .Id == $level1Dep [] ] | any )] as $level1Full | $level1Full [] | [.Dependencies []] as $level2Dep | [$original [] | select ( [ .Id == $level2Dep [] ] | any )] as $level2Full | [$level1Dep [], $level2Dep []]
https://jqplay.org/s/k-ZylbOC6W
{temp :.temperature ,hum :.humidity , id : (.message | capture ("ID (?<id>[[:digit:]]+)" ).id )}
https://jqplay.org/s/5TlSDgJnkc
https://jqplay.org/s/B-JW8wnqG3
del ( .a [].c [] | select (has ("e" )))
https://jqplay.org/s/-YDVDeXTHb
.gcp_price_list | del (.sustained_use_base ,.sustained_use_tiers ) | . [] | keys []
https://jqplay.org/s/xHWg8aGSSS
[(.. | objects .locator | strings ), (.. | select (objects . "#name" == "section-title" )._ )] | @tsv
https://jqplay.org/s/N6TboUkELM
.example . "sub-example" | map (.name )
https://jqplay.org/s/G2inYAJNLS
[.data.search.edges [].node | {name ,topic :(.repositoryTopics.nodes [].topic.topics )}]
https://jqplay.org/s/0AFneNK89i
[.data.search.edges [].node | {name ,topic :[.repositoryTopics.nodes [].topic.topics ]}]
https://jqplay.org/s/b7ByAsQ571
https://jqplay.org/s/MiJ9w1Sz5L
https://jqplay.org/s/DRkQwRC9Rx
reduce (paths (numbers ) as $p | [$p [1 :], getpath ($p )]) as $i ({}; setpath ($i [0 ]; getpath ($i [0 ]) + $i [1 ]))
https://jqplay.org/s/YPG4I9BMDn
[.items [] ] [] | [.id , .name ] | . [0 ]
https://jqplay.org/s/cEzh5_LimP
._embedded.items | map ({(.order | tostring ) : .technical._links.self.href } )
https://jqplay.org/s/YvpCb2PH42
https://jqplay.org/s/fDzVed_Isv
.a [] | .c [] | if .e then del (. ) else . end
https://jqplay.org/s/0-o4HOox-K
.assetbase [].assetbase [].items
https://jqplay.org/s/_6KVDfIn3m
.platform.target_id as $target | .profiles [].controls [] | { Host : $target , Title : .title , Status : .results [].status }
https://jqplay.org/s/S65ySzbF30
(now | todate ) as $_processDate | [. [].changes [] | (.change | scan ("\\ b(submitted|rejected)=true\\ b" )[] | {submitted :"submission" ,rejected :"rejection" }[. ]) as $type | {id , date , $type , user , $_processDate }]
https://jqplay.org/s/ydoCgv9vsI
.objectEntries [].attributes | {ticketid : . | map (select (.objectTypeAttributeId == 328 ))[0 ].objectAttributeValues [0 ].displayValue , date : . | map (select (.objectTypeAttributeId == 330 ))[0 ].objectAttributeValues [0 ].displayValue , hostnames : . | map (select (.objectTypeAttributeId == 329 ))[0 ] | [.objectAttributeValues [].displayValue ]}
https://jqplay.org/s/GV2zMjbCWK
.paths | {k :keys ,v :map (keys )}
https://jqplay.org/s/1jCG6soXuG
[to_entries [] | {value :(.value | arrays [] // . ), type :.key }]
https://jqplay.org/s/Ts97jkk21K
select (.potato as $k | ([1 ,2 ,3 ,4 ] | any (. == $k )))
https://jqplay.org/s/RBBKMUS2pv
[inputs | select ((. | length ) > 1 ) | split ("[[:space:]]+" ; "" ) ] | reduce . [] as $item ({}; . [$item [2 ]]= $item [1 ])
https://jqplay.org/s/ki8I1YnU56
map (.release_date = (.release_date | . as $date | try (strptime ("%Y-%m-%d" ) | mktime ) catch $date ))
https://jqplay.org/s/uBG5c969pf
{k :.id ,m :([.j [] | select (.f == 4 )| .d ][]// null )}
https://jqplay.org/s/E8rS0Mf_so
{k :.id ,m :.j [] | select (.f == 3 )| .d }
https://jqplay.org/s/Lx7eM2akzp
{ "absolute" : .t , "word" : .s []. "$t" , "relative" : .s [].t , }
https://jqplay.org/s/SI7XEMb5l9
{ widgets : (reduce . as $item ({}; . + {($item .name ): {url : $item .url }})) }
https://jqplay.org/s/exd2QjrS9V
{ errorMessage ,errorCode , orderId : (.orderId | map ({ (.orderId ) : { orderId , targetRequirements : (.targetRequirements | map ({ preferenceOrder ,targetID }) ) } }) ) }
https://jqplay.org/s/922RlkbFNA
. [] | { "y" : .foo , "x" : .bar [] }| [.y ,.x ] | @csv
https://jqplay.org/s/3gulSlZiWz
.amazon | { userType : .userType , userName : .user , itemCatalog : { itemId : .items [].id , name : .items [].name } }
https://jqplay.org/s/nM1WzWRmnK
{user : .results [].id , mail : .results [].buyer.email , buyer : .results [].buyer.billing_info.doc_number }
https://jqplay.org/s/xQgpA4yJAz
https://jqplay.org/s/vt_4IbskaS
{CompletedInstances ,status , "AppMap" : (.serviceResponse | map ( { (.appId ): .assets } ) | add ) }
https://jqplay.org/s/Wx741btZOg
.a | .b | .c [] | . [] | .x = 97
https://jqplay.org/s/-6c0QitFA7
.ideas | (map ( { (.preference_order ) : .ideaName } ) | add )
https://jqplay.org/s/qfItW5U-Tf
. [].Config.Env |= reduce (. [] | split ("=" )) as [$key , $value ] ({}; . [$key ] = $value )
https://jqplay.org/s/lh6QUQ0DO4
https://jqplay.org/s/_RZNr_oYwE
. [] | .product1.interval [] as $interval | {date : .date , time : ($interval .time // "N/A" ), price : ($interval .price //- 1 )}
https://jqplay.org/s/uRhNX-UglJ
.properties.periods [] | .shortForecast , .temperature , .windDirection , .windSpeed
https://jqplay.org/s/7lBj_kDoB3
. [].output | scan ("totalFailed+: [[:digit:]]+" )
https://jqplay.org/s/az56quLZa3
walk ( if type == "array" and . [0 ].schema ? then . + [{ "extra" :"param" }] else . end )
https://jqplay.org/s/CthSsOCQ-Y
[. [].methodResponse.params.param.value.struct.member [] | select (.name == "severity" ).value.string , select (.name == "product" ).value.string ] | [{severity :. [0 ], product :. [1 ]}]
https://jqplay.org/s/BWJwVdO3Zv
. [] as $parent | . [].behaviors [].name | select (. == "redirect" ) | $parent
https://jqplay.org/s/QTk42jn-a0
.id , (.records [].name + ":" + (.records [].value | tostring ))
https://jqplay.org/s/iEkMfm_u92
fromstream ([ [ "foo" , "a" ], 1 ],[ [ "foo" , "b" ], 2 ],[ [ "foo" , "b" ] ],[["foo" ]],[ [ "bar" , "a" ], 1 ],[ [ "bar" , "b" ], 2 ],[ [ "bar" , "b" ] ],[ [ "bar" ] ])
https://jqplay.org/s/4aeBOY9x6q
.resources [] | select (.type == "Microsoft.ApiManagement/service/apis" ) as $apis | { types : [.type ], apis : $apis }
https://jqplay.org/s/By94hv9gKj
. [0 ] | {FirstItem1 : . [0 ].items [0 ].firstitem1 } + (. [1 ] | {seconditem : . [0 ].items [0 ].seconditem1 })
https://jqplay.org/s/XVgl5UCDLM
.priceDimensions |= { ufrontFee : . [] | select (.unit == "Quantity" ) | .USD , hourFee : . [] | select (.unit == "Hrs" ).USD }
https://jqplay.org/s/h6_LfoEHLZ
.assets [] | select (.name == "atom-mac.zip" ) | .browser_download_url
https://jqplay.org/s/beaibywO2k
. [] | select (.rooms [].furniture | length > 0 ) | .id
https://jqplay.org/s/dGDswqAEte
.platforms [] | if ( .name == "CBus" ) then .accessories += [{ "values" : "NEW" }] else . end
https://jqplay.org/s/OerK1MlARS
[.format.filename ,.format.format_name ,.format.tags.album_artist ] | @csv
https://jqplay.org/s/qXW_QUYFv0
delpaths ([paths ] | map (select (contains (["1234" ]))))
https://jqplay.org/s/SiFSE3RxZV
.Functions [] | select (.Layers [] | contains ("layer2" ))
https://jqplay.org/s/BfAdRBZUMW
[group_by (.id )[]| add | { (.id ) : . } ]| add
https://jqplay.org/s/DsHYi7ixyn
.vertices | range (0 ;length ) as $i | select (. [$i ].alias == "polarized" and . [$i ].ns == "ca" ) | $i