Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-01-2020 01:19 PM
Hi guys
I am new to this community as well as neo4j
So actually the below is the question.
Node A(Member) Node B(Member)
Node C(Member sponsor)
Now I need to make relation between A and B using the properties of C.
It has to be work continuosly like a Trigger in MySQL.
The relation details will be on Node C only.
And it will work when ever data comes into the neo4j forever.
Is this possible.
10-01-2020 02:05 PM
If you can enable them on the server, you should be able to configure this with apoc triggers
10-01-2020 10:20 PM
Assume I am having member nodes with property like this already
{name:"a",empId:"123"}
{name:"b",empId:"222"}
{name:"c",empId:"333"}
{name:"d",empId:"444"}
Now the another new node came in with a new label as sponsor
{Name:"test",sourceEmpId:"123",destEmpId:"333"}
Name:"test",sourceEmpId:"222",destEmpId:"444"}
So generally the node with label sponsor came later.
As soon as that sponsor node start to arrives we need to create relation between the member nodes based on the sponsor properties of source and destination emp id.
Can anyone help on this situation??
Any help appreciated
10-16-2020 12:16 AM
Would it make sense to modify the sponor insert transaction in such a way that it creates the relation?
match(s:Member) where s.empID="123" with s
match (d:Member) where d.empID="333" with s,d
merge(sp:MemberSponsor {Name:"test", sourceEmpId="123",destEMPId="333"}) with s,d,sp
merge (s)-[r:MyRelation]->(d)
i depending on other requirements I would model the sponsorship real like
match(s:Member) where s.empID="123" with s
match (d:Member) where d.empID="333" with s,d
merge(sp:MemberSponsor {Name:"test"}) with s,d,sp
merge (s)-[p:MyRelation]->(sp)-[s:MyRelation]->(d)
This could probably better leverage the benefit of graph libraries.
All the sessions of the conference are now available online