cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Parse json with Cypher

12kunal34
Graph Fellow

Hi Everyone,

I have a json structure like below.

  'ha': StringType(),  
  'confirmations': LongType(), 
  'previousha': StringType(), 
  'nextha': StringType(), 
  'ax': [{  
      'axid': StringType(), 
      'ha': StringType(), 
      'ex': StringType(), 
      'win': [{  
          'axid': StringType(), 
          'Sig': {'as': StringType(),'ex': StringType(),'seq': LongType()},  
          'sequence':LongType(), 
        }], 
      'wout': [{  
          'value': DoubleType(),'n': LongType(), 
          'Pub': {
            'type': StringType(), 
            'addresses': [StringType()]} 
        }]}]}

i want to parse above json structure and want to create nodes for each addresses element and for each 'ax' element.

please help me into this

1 REPLY 1

anthapu
Graph Fellow

Hi Kunal,
How are you passing this data to Neo4J? If you are using client driver then Cypher is map friendly and json parameter will be converted to MAP.

If you are loading it from file then please look at apoc.load.json method.

Here's a blog post that explains it's usage.