cypher - Neo4j - multiple tasks with OPTIONAL MATCH -


I am new to Ne04j, I have to write a cipher query for the following status

Possiblity 1:

  • < Delete the Next relationship of user1 with data1 .

  • Next relationship

  • from user2 >
  • Relationship to data1 Next data2

Possiblity 2:

data to user relationship < Strong> Next .

The problem is with Possiblity 1, I delete the relationship and create relationships at the same time could not do.

I have tried the following questions, but it fails

  match (a: user {id: 12345}) opti (A) - [: NEXT] - & Gt; (C: Data {ID: 1}) - [: Next] - & gt; (B) with unique make (A) - [: NEXT] - & gt; (C: data {id: 2})  

Please help, thank you in advance

Use the following from the cipher query together (a) - [: next] - & gt; A, C matte (A) - [R: with data {id: "2"}) with

  MATCH (a: user {id: "12345"}) NXT] - & gt; (B: Data) where B, together with C, C (R), collect (R), (B) AS B, C FOREACH (0, length (rels) -1). FOREACH (T1N [SL] [FOR] (T2N [SLLS [T]] Emerg C - [: NXT] -> T1 Dailyty T2) Return A, c  < / Pre> 

will create a new connection with node one and data node c from the above query id: "2" and if Any other node of the previously connected data type will be added after the new node c


Comments