使用例
List only services that passed their readiness checks
入力
[{"name":"api","ready":true},{"name":"scheduler","ready":false},{"name":"worker","ready":true}]Expected answer
["api","worker"]- クエリ
[.[] | select(.ready) | .name]- 生データ
Off
Add line-item prices without floating-point currency
Amounts are integer cents; the total is 3,750 cents, or $37.50.
入力
[{"item":"storage","cents":1250},{"item":"compute","cents":2400},{"item":"transfer","cents":100}]Expected answer
3750- クエリ
[.[].cents] | add- 生データ
Off
Count requests inside a nested API response
入力
{"page":1,"requests":[{"id":"req-a"},{"id":"req-b"},{"id":"req-c"}]}Expected answer
3- クエリ
.requests | length- 生データ
Off
Copy a release tag without JSON quotation marks
入力
{"release":{"tag":"v2.4.1","draft":false}}Expected answer
v2.4.1- クエリ
.release.tag- 生データ
On
Use a full name when the nickname is missing
入力
{"nickname":null,"name":"Ada Lovelace"}Expected answer
Ada Lovelace- クエリ
.nickname // .name- 生データ
On
Reject an integer jq cannot safely represent
jq uses floating-point numbers. Quote identifiers that exceed its safe integer range.
入力
{"id":9007199254740995}Expected rejection
Message containsNumber exceeds safe precision- クエリ
.id- 生データ
Off
Select a quoted 64-bit identifier without losing digits
入力
{"id":"18446744073709551615"}Expected answer
"18446744073709551615"- クエリ
.id- 生データ
Off
Get JSON Property
入力
{"data": "testString\u0000"}Expected answer
JSON"testString\u0000"- クエリ
.data- 生データ
Off
Get raw JSON Property
入力
{"data": "testString\u0000"}Expected answer
Hexadecimal bytes74 65 73 74 53 74 72 69 6e 67 00- クエリ
.data- 生データ
On