Limit the input into relationship property values to property values that the node already has

Hi,

I am new to Neo4j and Cypher. I am Using Neo4j Desktop On Windows and try to improve efficiency our internal operations.

Currently, I have two nodes and a relationship connecting them. One of the nodes and a relationship have common property. I want to limit the input into relationship property values to property values that the node already has. Are there any ways to solve this issue?

Thanks in advance.

If I understand correctly, here is a solution:

match (a:Test1)
match (b:test2 {param: "new"})
with a, b
merge (a)-[:REL {param: b.param}]->(b)

2 Likes

Thank you @ameyasoft !
The issue that had plagued me for a long time is solved immediately by your advise!

Glad to help you. Thanks for your appreciation!!

1 Like