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.

APOC Export JSON Append to Existing File

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