Apoc.export.json.all - can this work with a stream?

I am trying to use apoc.export.json.all and was hoping that it would work like the apoc.export.csv.all in that you can specify:

CALL apoc.export.csv.all(null, { stream: true, batchSize: 10000 }) YIELD data

I would like to use that so I can stream the data rather than having to dump to a file. Is there any way to do this?

Here is what I get when I try to dump this to a stream:

$ docker exec -it neo4j bin/cypher-shell 'call apoc.export.json.all(null, { stream: true, writeNodeProperties: true, batchSize: 100 })'
Failed to invoke procedure `apoc.export.json.all`: Caused by: java.lang.OutOfMemoryError: Java heap space

Changing that to apoc.export.csv.all does not have this problem.

I believe we have figured out why it's not streaming. Will probably issue a pull request at some point as we locally have modified apoc.export.json.all to handle when stream: true is set to actually stream the data like the CSV export does.