Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store a map or json object as a property in neo4j?

Tags:

neo4j

cypher

I'm trying store a map or json object as a property in Neo4j, but it doesn't work.

like image 892
kien bui Avatar asked Jun 05 '17 07:06

kien bui


1 Answers

That's a limitation of node properties right now. You have a few workarounds to choose from.

  1. You can turn your json object into a string and save it as a property. You can use APOC Procedures to convert JSON strings to and from Cypher map objects.

  2. You can instead save the map properties as properties on the node, though that loses the grouping you would get from the object itself.

  3. If #2 isn't enough, you could also alter your graph model so the data in the JSON object corresponds to graph objects, nodes and properties related to the original node.

like image 176
InverseFalcon Avatar answered Oct 24 '22 09:10

InverseFalcon