apoc.convert.setJsonProperty
Procedure APOC Core
apoc.convert.setJsonProperty(node,key,complexValue) - sets value serialized to JSON as property with the given name on the node
Usage Examples
The examples in this section are based on the following sample graph:
CREATE (:Person {json:'{a:[1,2,3]}'});
MATCH (p:Person)
CALL apoc.convert.setJsonProperty(p, 'json', {a: [4,5,6]})
RETURN p
p |
---|
(:Person {json: "{\"a\":[4,5,6]}"}) |
We can extract the JSON value from the node using apoc.convert.getJsonPropertyMap:
MATCH (p:Person)
RETURN apoc.convert.getJsonPropertyMap(p, "json") AS map;
map |
---|
{a: [4, 5, 6]} |