Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-15-2021 08:57 AM
Hi,
I'm trying to export the results of a cypher query (nodes and relationships) into a new database, because I want a subset of my database that uses less memory for a large query. I found this: Export to Cypher Script - APOC Documentation but it doesn't bring back all the relationships(Apoc.export.cypher.query not creating all relationships that were exported). Is there a better way to do this? Thanks!
Oleg
07-15-2021 09:16 AM
Hi Oleg
Please after export it as a. dump file so that you can reimport it in your brand new cluster/node configuration. Also please make sure that admin command line tool is installed so that you can successfully invoke admin import copy or similar commands.
Thanking you
Sameer
07-15-2021 11:25 AM
Hi @sameer.gijare14 is it possible to make a .dump file of just a query? I don't need the whole database, just the results of a query? Do you have a link with instructions?
07-15-2021 02:49 PM
Try using apoc.export.json.query:
CALL apoc.export.json.query(
"MATCH (c)-[r]-(d)-[r1]-(b)-[r2]-(f)
with collect(distinct c) + collect(d) + collect(b) + collect(f) as nodes,
collect(r) + collect(r1) + collect(r2) as relationships
RETURN nodes, relationships", null, {stream: true}) YIELD data
RETURN data
07-15-2021 07:00 PM
I ended up using the graphml version of the export and import, and it worked fine, I got all my nodes and relationships.
Still not sure why the apoc.export.cypher.query version didn't work on import and missed all the relationships.
08-12-2021 08:39 AM
Hi Oleg
There is a command known as call graph. db. schema.export(Cypher query).
Thanking you
Yours faithfully
Sameer S Gijare
All the sessions of the conference are now available online