APOC Export JSON Append to Existing File


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\",
   ) YIELD file RETURN file",
   {batchSize: 500}