Update node
Change one value in JSON, found by its path; a list there can be replaced or added to.
Command in the JSON toolkit · id ooa.json/update_node · 7 inputs (1 required), 2 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Value | Any | No | Dictionary, List or JSON text (or use an open JSON session). | |
| Path | String | Yes | Path of the node to change. | |
| Node | Any | No | New value. | |
| Create if missing | Boolean | No | false | Add the key when it does not exist instead of failing. |
| Value type | String | No | as_given | Type the new value gets in the JSON: as given, text, a number, true/false, JSON (text such as {"a": 1} becomes an object or list) or null. |
| If list | String | No | replace | When the node at the path is a list: replace the whole list with the new value, or add the new value (each item of a new list) at its end. |
| Session | String | No | Work on the document of this JSON session (Start session) instead of a value; changes stay in the session until End session saves them. |
Outputs
| Output | Type | What it is |
|---|---|---|
| value | Any | Updated document. |
| previous | Any | The value that was replaced. |