cancel
Showing results for 
Search instead for 
Did you mean: 

Create relationships only in the Browser

CD007
Node Link

Hi

I want to add a relationship in Neo4j browser and then I will start to connect the nodes using Bloom. I'm using Aura.

However when I enter the following in the browser it just does nothing - is this the correct syntax to add a relationship? 

 
CREATE (node1)-[:IS_PARENTOF]->(node2) 

All I want to do is add relationship names and every example I come across any mention it only talks about creating a relationship between nodes.

Thanks

Chris

 

1 ACCEPTED SOLUTION

your 'name' property is lowercase, but you are using 'Name' in the query. 

View solution in original post

3 REPLIES 3

glilienfield
Ninja
Ninja

Yes, relations are created between two nodes. They do not live in isolation. That query should create two nodes without Labels nor properties and create a relationship between them. I doubt that is what you want. Typically you would match or merge to get each node and the create the relationship between the two found nodes using a statement simulate yours. I suggest using merge instead so the relation is not created each time if it already exists. 

thanks - I don't get why this is failing - both nodes exist and there is a name label for each of them

MATCH (a:AHU),(b:DOAS)
WHERE a.Name = "AHU" AND b.Name = "DOAS"
CREATE (a)-[r:RELEASED]->(b)
RETURN r
 
CD007_0-1667316782175.png

 

example node of AHU - 

CD007_1-1667316884227.png

 

your 'name' property is lowercase, but you are using 'Name' in the query.