Applies a patch or a merge patch on the input JSON column.
When a (merge) patch cannot be applied, missing values will be generated, node execution will not fail.
See also the node: JSON Diff.
Given {"a":"b","c":{"d":"e","f": "g"} }
let us assume the target is {"a":"z","c":{"d":"e"} }
(changing a
's value to z
and
removing f
). To achieve this, either the following patch should be applied:
[{"op":"replace","path":"/a","value":"z"},{"op":"remove","path":"/c/f"}]
or
this merge and patch: {"a":"z","c":{"f": null} }
The following operators (op
) are supported for patch:
add
(path
, value
)remove
(path
)replace
(path
, value
)move
(from
, path
)copy
(from
, path
)test
(path
, value
)The merge and patch format reconstructs the parts that need to be changed (changes included), all else can be omitted.
It uses the fge/json-patch implementation.
To refer to flow variables, use the $${TflowVarName}$$
syntax (where T
is S
for String type, D
for floating point numbers and I
for integer numbers).
To refer to columns (boolean, numeric, String, JSON), use the $columnName$
syntax.
References to (0
-based) row index ($$ROWINDEX$$
), row count ($$ROWCOUNT$$
) and row keys ($$ROWID$$
) can also be used in values.
You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.
To use this node in KNIME, install the extension KNIME JSON-Processing from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Deploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.