JSONUpdater

Modifies JSON documents by performing one or more actions:

  • Inserting a new value into a JSON object or array
  • Replacing an existing value in a JSON object or array
  • Merging the contents of two JSON objects or arrays
  • Removing a value from a JSON object or array
  • Appending a value to a JSON array
  • Renaming a key in a JSON object.

为每个文档ument update, a JSON path expression is used to identify the location of the JSON object or array which is to be modified.A second parameter names the specific object key or array index which is to be changed.Note that the path may refer to more than one item.If this is the case, all the items will be modified.

The JSON path expressions used in this transformer are the same as those used in theJSONExtractorandJSONFragmentertransformers, and in the JSON reader.

For modifications that replace existing items or insert new items, two parameters are given which specify the value to be added to the document.This value may be given as a simple text value, or it may be anXQueryexpression, a JSON object or a JSON array.

The更新features provide the attribute values used in the document update operations.The文献feature is only used to supply the JSON document which is to be updated.

For each feature that enters the更新port, all of the update operations listed in the transformer will be applied to each feature that entered the transformer through the文献port.Therefore, no changes will be made to the JSON document if no features enter the transformer through the更新port.

Note that if the document is entered directly into the transformer parameters, it may be processed in two different ways:

  • If no文献features are given to the transformer, a new feature will be created to store the document.Each of the updates will be applied to the document, and it will then be output through the文献port.
  • If文献features are given to the transformer, each of the updates will be applied to the document, and these features will be output from the transformer.

Input Ports

Output Ports

Parameters

Transformer

JSON Document

更新s

Each row in the Updates table specifies a single update operation.

Parameters

Editing Transformer Parameters

Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace.More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers.To access a menu of these options, clickbeside the applicable parameter.For more information, seeTransformer Parameter Menu Options

Transformer Categories

Format Specific

Web

FME Licensing Level

FME Professional edition and above

FME Community

The FME Community is the place for demos, how-tos, articles, FAQs, and more.Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.

Search for samples and information about this transformer on theFME Community