Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-14-2019 07:25 PM
I have a graph where each relationship has a uuid.
Eg.
CREATE (n1)-[r:SOME_LABEL]->(n2)
SET r.uuid= apoc.create.uuid()
Is there an efficient way to find these nodes again if all I know is the uuid of the relationship?
Because I don't know the Labels of the nodes or the relationship I end up with this
MATCH (n1)-[r]->(n2)
WHERE r.uuid="the uuid"
RETURN n1,n2
I expect this is a REALLY BAD thing to do, as it would get every single pair of nodes and then filter to the 1 joined by the relationship with that uuid.
Is there a better way to do this or do I need to re-think my design?
12-14-2019 09:41 PM
I think you're going to want to remodel your design. If you can share your model we can offer up opinions. Essentially I think you're going to want to insert a node in that relationship, then you can index off of that id.
12-16-2019 10:45 AM
I agree with @mike.r.black. If you are depending on an assigned UUID value of a relationship then you are not taking advantage of a graph database. We can help you to a certain extent with your design if you care to share it here.
12-16-2019 11:17 AM
I agree. This was the path that I was headed down. Just thought I would 'put it out there' before doing a redesign.
Thanks
All the sessions of the conference are now available online