Export relation to CSV

Hello everyone again!

I want to export one relation that I have created to a csv file (unfortunatelly everyone at my office is more familiar to Excel than to Neo4j).

I have already added to my neo4j.conf file the cod:
apoc.export.file.enabled=true

I also know how to export, and that the export.csv file is located in the import folder (this took me some time :rofl: :rofl:).

The point is that I have only been able to export the whole table, not my relationship defined.

This is my relationship:
MATCH (d:asia)<-[:son]-(p:person)
WITH p, count(d) as brothers
WHERE numResidents >=2
MATCH (d:asia)<-[:son]-(p:person)
RETURN d, p

But I do not know where to put it in the clause:
CALL apoc.export.csv.all("familyInfo.csv", {})

Any help will be more than welcome!!!!!

Hello!

Did you know that you can export to CSV from Neo4j Browser?

If you want to use apoc, you simply need to change from apoc.export.csv.all to apoc.export.csv.query. Your command would look like this.

CALL apoc.export.csv.query("
MATCH (d:asia)<-[:son]-(p:person)
WITH p, count(d) as brothers
WHERE numResidents >=2
MATCH (d:asia)<-[:son]-(p:person)
RETURN d, p", "familyInfo.csv", {})

Thanks Nathan!!!!

I knew about the download option, not about the apoc.export.csv.query. With this works perfect.

Thanks!! :laughing:

Hi @nsmith_piano ! Can I use " apoc.export.csv.query" for "apoc.export.csv.data" too for this issue: Memory issues using apoc.export.csv.data I am running from the browser too.

Thanks!