Closed Dikowda closed 1 year ago
Surround the field name with double-quotes .foo,."ba-r"
.
An example for the command line for demonstration.
$ echo '{ "foo": 42, "ba-r": "something else", "baz": true}' | jq '.foo,.ba-r'
jq: error: r/0 is not defined at <top-level>, line 1:
.foo,.ba-r
jq: 1 compile error
$ echo '{ "foo": 42, "ba-r": "something else", "baz": true}' | jq '.foo,."ba-r"'
42
"something else"
Jqplay is unable to extract data from keys which include minus character. Example. .ba-r returns
I than seen api's return json with keys like this.