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
As I understand, I can replace value via this command: json -I -f test.json -e "this.name='andrew'"
But how can I replace a value for this key -> last.name?
I mean when I try to replace the value via this command json -I -f test.json -e "this.last.name='andrew'"
I got:
undefined:3
this.last.name='andrew'
^
TypeError: Cannot set properties of undefined (setting 'name')
at Object.eval (eval at main (/usr/local/lib/node_modules/json/lib/json.js:1365:27), <anonymous>:3:15)
at parseChunk (/usr/local/lib/node_modules/json/lib/json.js:1569:29)
at /usr/local/lib/node_modules/json/lib/json.js:1426:13
at getInput (/usr/local/lib/node_modules/json/lib/json.js:738:17)
at main (/usr/local/lib/node_modules/json/lib/json.js:1396:9)
at Object.<anonymous> (/usr/local/lib/node_modules/json/lib/json.js:1764:5)
The text was updated successfully, but these errors were encountered:
As I understand, I can replace value via this command:
json -I -f test.json -e "this.name='andrew'"
But how can I replace a value for this key -> last.name?
I mean when I try to replace the value via this command
json -I -f test.json -e "this.last.name='andrew'"
I got:
The text was updated successfully, but these errors were encountered: