Skip to main content

Hi,

=============================

How to delete the key "x" in a json attribute by JsonUpdater transformer:

{
"x" : "aa",
"y" : "bb"
}

=============================

I send the feature both into the ports of "Document" and "Update", and set

Update Type: "Delete From Object"

JSON Path: json

  • Object / Array Index: x

    =============================

    but get warnings below:

    2016-06-16 17:27:38| 0.2| 0.2|WARN |JSONUpdater(XQueryFactory2): The following error occurred while executing query number 1:

    2016-06-16 17:27:38| 0.2| 0.0|WARN |JSONUpdater(XQueryFactory2): The following error occurred near line 3, column 21 of the query:

    2016-06-16 17:27:38| 0.2| 0.0|WARN |JSONUpdater(XQueryFactory2): xs:string can not be promoted to parameter type json-item() of function json-item-accessor()

    =============================

    Thanks

  • Hi @endest, json

  • indicates any member belonging to the root value, so your setting means "remove x from any member object contained by the root". You can set just json to the JSON Path to indicate the root. Try this.

    • JSON Path: json

  • Works fine!

    Hi @endest, json

  • indicates any member belonging to the root value, so your setting means "remove x from any member object contained by the root". You can set just json to the JSON Path to indicate the root. Try this.

    • JSON Path: json
  • And again... Takashi saves my day ;-)

    I started off with json

  • and no result, but now it makes sense...


  • Reply