Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-14-2020 02:01 AM
Hi all,
I want to know if there is a way to copy nodes/relationships from a db to another db in the same dbms? Also would it be possible to create a db when a particular node/relationship is created in the same dbms?
Thanks in advance
Solved! Go to Solution.
07-14-2020 09:05 AM
On the first question, in 4.1 you can use fabric queries to query multiple graphs. Doing this, you could match a node in one graph, and then CREATE the same node in a second graph.
https://neo4j.com/docs/operations-manual/current/fabric/queries/#fabric-query-multiple-graphs
On the second question - please have a look at APOC triggers:
http://neo4j-contrib.github.io/neo4j-apoc-procedures/3.5/operational/triggers/
Basically what you would want to do is create an APOC trigger that only fires when the nodes you are interested in are created. When that happens, you can use other APOC / cypher calls to do things like run the CREATE DATABASE statement on the systemdb
07-14-2020 09:05 AM
On the first question, in 4.1 you can use fabric queries to query multiple graphs. Doing this, you could match a node in one graph, and then CREATE the same node in a second graph.
https://neo4j.com/docs/operations-manual/current/fabric/queries/#fabric-query-multiple-graphs
On the second question - please have a look at APOC triggers:
http://neo4j-contrib.github.io/neo4j-apoc-procedures/3.5/operational/triggers/
Basically what you would want to do is create an APOC trigger that only fires when the nodes you are interested in are created. When that happens, you can use other APOC / cypher calls to do things like run the CREATE DATABASE statement on the systemdb
07-14-2020 02:46 PM
Hi @david.allen
Thanks for the response.
For the first question, is there a way to do this without using fabric as this is only available in enterprise edition?
07-21-2020 04:10 AM
you could do it by writing a program using the official drivers. You could then create connections to two separate databases, query from one, and then use that to inform a write query to the other.
All the sessions of the conference are now available online