json_add(key,data)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
key | The key corresponding to json | string | Yes | - | - |
data | Add new nodes | dict | Yes | - | - |
{"content": "{\\"a\\":{\\"b\\":{\\"c\\":\\"cc\\"}}}"}
json_add("content", {"a":{"b":{"d":"dd"}}})
{"content": "{\\"a\\":{\\"b\\":{\\"c\\":\\"cc\\",\\"d\\":\\"dd\\"}}}"}
json_edit("result", path="", key="",value="333",index=1,mode="edit")
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
field | The key corresponding to the nested json | string | Yes | - | - |
path | The directory corresponding to the target field to be deleted or modified. Leave this field blank if the field to be deleted or modified is at the first level of the nested json. When operating on array elements, fill in the key corresponding to the array. Supports JMES syntax. | string | No | - | - |
key | The target field to be deleted or modified. Leave this field blank when operating on array elements. | string | No | - | - |
value | The new value to be set. Required only when a value is modified. | string | No | - | - |
index | Fill in this field when operating on an array. Array elements start from 1. | number | No | 0 | - |
mode | Mode. Edit: edit, Delete: move. Default: move | string | No | move | - |
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"p18\\":\\"CN\\"}","time":"1650440364"}
json_edit("content", path="", key="p18", value="hello", mode="edit")
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"p18\\":\\"hello\\"}", "time":"1650440364"}
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"p18\\":\\"CN\\",\\"info\\":{\\"province\\":\\"hubei\\",\\"geo\\":{\\"long\\":\\"111\\",\\"lati\\":\\"222\\"}}}","time":"1650440364"}
json_edit("content", path="info.geo", key="long", value="333", mode="edit")
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"p18\\":\\"CN\\",\\"info\\":{\\"province\\":\\"hubei\\",\\"geo\\":{\\"long\\":\\"333\\",\\"lati\\":\\"222\\"}}}","time":"1650440364"}
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"p18\\":\\"CN\\",\\"info\\":{\\"province\\":\\"hubei\\",\\"geo\\":{\\"long\\":\\"111\\",\\"lati\\":\\"222\\"}}}","time":"1650440364"}
json_edit("content", path="", key="p18", mode="move")
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"info\\":{\\"province\\":\\"hubei\\",\\"geo\\":{\\"long\\":\\"111\\",\\"lati\\":\\"222\\"}}}","time":"1650440364"}
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"p18\\":\\"CN\\",\\"info\\":{\\"province\\":[\\"hello\\",\\"world\\"],\\"geo\\":{\\"long\\":[\\"1.0\\",\\"2.0\\"],\\"lati\\":\\"222\\"}}}","time":"1650440364"}
json_edit("content", path="info.province", index=1, mode="move")
{"content":"{\\"p9\\":[\\"0.0\\",\\"0.0\\"],\\"p18\\":\\"CN\\",\\"info\\":{\\"province\\":[\\"world\\"],\\"geo\\":{\\"long\\":[\\"1.0\\",\\"2.0\\"],\\"lati\\":\\"222\\"}}}","time":"1650440364"}
json_select(data, jmes="")
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | Field value, which can be extracted by other functions. | string | Yes | - | - |
jmes | string | Yes | - | - |
{"field": "{\\"a\\":{\\"b\\":{\\"c\\":{\\"d\\":\\"success\\"}}}}", "status": "500"}
fields_set("message", json_select(v("field"), jmes="a.b.c.d"))
{"field":"{\\"a\\":{\\"b\\":{\\"c\\":{\\"d\\":\\"success\\"}}}}","message":"success","status":"500"}
json_update(json_value, key1, value1, key2, value2)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
field | The key corresponding to json | string | Yes | - | - |
Variable parameter | The key-value pairs to be added into the json | string | Yes | - | - |
{"data": "{\\"c\\":\\"d\\"}"}
json_update("data", "11", "22")
{"data":"{\\"11\\":\\"22\\",\\"c\\":\\"d\\"}"}
{"data": "{\\"c\\":\\"d\\"}","name": "test","timestamp": 1734567890,"status": true}
json_update("data", "11", "11", "22", "22", "33")
{"data":"{"11":"11","22":"22","c":"d"}","name": "test","status":"true","timestamp":"1734567890"}
xml_to_json(data)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | Field Value | string | Yes | - | - |
{"xml_field": "<note><to>B</to><from>A</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>", "status": "500"}
fields_set("json_field", xml_to_json(v("xml_field")))
{"xml_field":"<note><to>B</to><from>A</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>","json_field":"{\\"to\\":\\"B\\",\\"from\\":\\"A\\",\\"heading\\":\\"Reminder\\",\\"body\\":\\"Don't forget me this weekend!\\"}","status":"500"}
json_to_xml(data)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | Field Value | string | Yes | - | - |
{"json_field":"{\\"to\\":\\"B\\",\\"from\\":\\"A\\",\\"heading\\":\\"Reminder\\",\\"body\\":\\"Don't forget me this weekend!\\"}", "status": "200"}
fields_set("xml_field", json_to_xml(v("json_field")))
{"json_field":"{\\"to\\":\\"B\\",\\"from\\":\\"A\\",\\"heading\\":\\"Reminder\\",\\"body\\":\\"Don't forget me this weekend!\\"}","xml_field":"<ObjectNode><to>B</to><from>A</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></ObjectNode>","status":"200"}
if_json(data)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | Field Value | string | Yes | - | - |
{"condition":"{\\"a\\":\\"b\\"}","status":"500"}
t_if(if_json(v("condition")), fields_set("new", 1))
{"new":"1","condition":"{\\"a\\":\\"b\\"}","status":"500"}
{"condition":"haha","status":"500"}
t_if(if_json(v("condition")), fields_set("new", 1))
{"condition":"haha","status":"500"}
array_get(array, index)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
Array | Array | string | Yes | - | - |
Index position | Retrieve the value at a specified index in the array | int | Yes | - | - |
{"field1": "[1,2,3]"}
fields_set("field2", array_get(v("field1"), 0))
{"field1":"[1,2,3]","field2":"1"}
{"field1": "['tom','jerry','bobo']"}
fields_set("field2", array_get(v("field1"), 0))
{"field1":"['tom','jerry','bobo']","field2":"tom"}
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan