Closed hmarko closed 10 months ago
Hey, i think this is because leaf_paths/0
was removed in 1.7. See https://github.com/jqlang/jq/pull/2666
@hmarko Let us know if you have more questions. Feel free to hop on our discord server if you need more help.
Hi.
I'm trying to run the following jq via jqplay and it fails while running the same using jq cli works:
This should be working with any json input.
query: .|[leaf_paths as $path|{key: $path|join("^"), value: getpath($path)}]
jqplay result: jq: error: leaf_paths/0 is not defined at, line 1:
.|[leaf_paths as $path|{key: $path|join("^"), value: getpath($path)}]
jq: 1 compile error exit status 3
CLI:
cat /tmp/a.json | jq '.|[leaf_paths as $path|{key: $path|join("^"), value: getpath($path)}]' [ { "key": "glossary^title", "value": "example glossary" } ]