我想请您为我这样的新手提供有关在示例文件上测试查询的指南。我在测试时遇到编译错误。请就需要调整的内容提出建议。
JSON文件-> sample.json
{
"lambda": {
"apple": [
{
"type": "fruit",
"color": "red",
"shape": "round",
"cron": "0/10 * * * ? *"
}
],
"orange": [
{
"type": "fruit",
"color": "orange",
"shape": "round",
"cron": "0/15 * * * ? *"
}
],
"apple-cider": [
{
"type": "juice",
"color": "pink",
"shape": "none",
"cron": "0/30 * * * ? *"
}
]
}
}
我在尝试从apple-cider获取数据时收到此jq:1编译错误消息
# jq -r ".lambda."apple-cider"[].shape" test.json
jq: error: cider/0 is not defined at <top-level>, line 1:
.lambda.apple-cider[].shape
jq: 1 compile error
我想请您为我这样的新手提供有关在示例文件上测试查询的指南。我在测试时遇到编译错误。请提出需要调整的建议。 JSON文件-> ...
[此回复回答了最初发布的问题。修改之前,输入的是JSON对象流。]