cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Trouble with Node Parsing in Multiple Passes

mbandor
Graph Voyager

I have a scenario where I need to make 2 separate passes through a node and extract a Jira ID to create another node and relationship. The first pass seems to work but making the second pass doesn't pickup all of the information. For example

MATCH (o:OS) WHERE o.Jira_ID_1 <> "na"
MERGE (j:JIRA {Jira_ID: o.Jira_ID})
MERGE (o)-[:HAS]->(j)

MATCH (o:OS) WHERE o.Jira_ID_2 <> "na"
MERGE (j:JIRA {Jira_ID: o.Jira_ID})
MERGE (o)-[:HAS]->(j)

RETURN o, j;

If I use a "WITH (o) for the second pass, it doesn't catch all of the tickets. Any ideas how to do this in one script? An entry may have 0, 1 or 2 Jira tickets in it. If I run this as 2 separate scripts it extracts the data just fine.

1 ACCEPTED SOLUTION

mbandor
Graph Voyager

Okay, I figured out if you add a semicolon after the first pass, it treats the 2 as separate and can run in a single pass.

View solution in original post

1 REPLY 1

mbandor
Graph Voyager

Okay, I figured out if you add a semicolon after the first pass, it treats the 2 as separate and can run in a single pass.