Overview
The JSON_decode()
function converts a JSON-formatted string to an object and returns the object.
Syntax
JSON_decode(str)
Argument | Type | Description |
---|---|---|
str |
String | The JSON-formatted string |
Return type: Object
Example of Result
return JSON_decode('{"name":"Lisa","age":23}')
Result: {"name":"Lisa","age":23}
Example of Use
Parse JSON-formatted data into usable object format, and dynamically update nodes based on the keys of the parsed object.
UNCOLLECT ['{"name":"Lisa","age":23}', '{"name":"Paul","age":35}'] as strings
with JSON_decode(strings) as object
update().nodes({name == object.name}).set({age: object.age})