cancel
Showing results for 
Search instead for 
Did you mean: 

APOC Export JSON Append to Existing File

jona
Node

Hello!

I am trying to use apoc.export.json.query() inside of a apoc.periodic.iterate() call.

In my Cypher query below, only the last result is saved to the "output.json" file as I presume the previous results are overwritten. Is there a way to append to the existing json file as we iterate?

CALL apoc.periodic.iterate(
   "MATCH (n:Person) RETURN n",
   "CALL apoc.export.json.query(
      \"RETURN $n.name AS name\",
      \"output.json\",
      {params:{n:n}}
   ) YIELD file RETURN file",
   {batchSize: 500}
)

Thanks!

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.