-1

I try to add a new node to an existing graph in neo4j, and try to create a mapping between the new node(BAI09.03) and an existing node(PR.IP-6) but am getting it like this

enter image description here

but my output should be like this

enter image description here

2 Answers2

0

There must be something wrong in your query :)

I suspect you do a MERGE to find your PR.IP-6 node, but you provide a property value that does not correspond, and then Neo4j will create a new node.

If you can provide the query you use, we can help you further.

Graphileon
  • 5,275
  • 3
  • 17
  • 31
0

You can do like this:

CREATE (s:Sample {sampleNumber: toInteger("1234567")})
WITH s
MATCH (p:Person {personNumber: toInteger("1234")})
CREATE (p)-[:Person_Sample]->(s)

Suppose we have already a node in the neo4j with personNumber: 1234 and we are creating a new node as Sample.

Learner
  • 1,170
  • 11
  • 21