You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the interactive tutorial, following suit with single quotes succeeds in the first two exercises:
Given: 'product' (type "data?" to view)
Challenge: Create a new object containing just the "name" field
> '{name}'
--------------------------------
Given: 'product' (type "data?" to view)
Challenge: Construct an array containing the product's name
> '[.name]'
But fails in the 3rd:
--------------------------------
Given: 'product' (type "data?" to view)
Challenge: Extend the product with { color: "red" }
> '{ price, name, "color":"red" }'
Command failed: jq ''{ price, name, "color":"red" }'' /usr/local/lib/node_modules/jq-tutorial/data/product.json
jq: error: syntax error, unexpected $end (Unix shell quoting issues?) at <top-level>, line 1:
{
jq: 1 compile error
I had no idea what I was doing wrong. Finally looked at the solution the in code and realized I was expected to omit the single quotes:
> { price, name, "color":"red" }
Suggest calling out in the instructions to omit them (or making it work with single quotes).
I'd be happy to update the instructions if you agree. Thanks!
The text was updated successfully, but these errors were encountered:
Suggest calling out in the instructions to omit them (or making it work with single quotes).
I'd be happy to update the instructions if you agree. Thanks!
Given the command-line experience updating the script to ignore (optional) single quotes seems like a good change to make... but at the very least, a "don't worry about escaping strings" note would save folks from tripping up on this in the future. +1 from me!
The instructions for the "objects" lesson always show what follows
jq
enclosed in single quotes, e.g. the'[.foo]'
in the first example:In the interactive tutorial, following suit with single quotes succeeds in the first two exercises:
But fails in the 3rd:
I had no idea what I was doing wrong. Finally looked at the solution the in code and realized I was expected to omit the single quotes:
Suggest calling out in the instructions to omit them (or making it work with single quotes).
I'd be happy to update the instructions if you agree. Thanks!
The text was updated successfully, but these errors were encountered: