Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-13-2020 03:58 AM
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 ).
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!!!!!
Solved! Go to Solution.
02-13-2020 04:20 AM
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", {})
02-13-2020 04:20 AM
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", {})
02-13-2020 05:37 AM
Thanks Nathan!!!!
I knew about the download option, not about the apoc.export.csv.query. With this works perfect.
Thanks!!
02-13-2020 06:17 AM
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!
All the sessions of the conference are now available online