cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

need suggestions for writing query

Ajithkumar
Node

Hi there ,

How to remove same node relationships globally
with one line query.

How to query the nodes must have both side
of same relationships.

kindly see the attachments for better understandings
properties for each nodes : 

countryCode 91
mobile MEFYNnF2cW1aWkZKeHBpRaTNnZz09OjoxMTEwMDAxMTAw
name khyati
userId 14161218
1 ACCEPTED SOLUTION

glilienfield
Ninja
Ninja

To delete relationships that refer to the same node:

match(a)-[r]-(a) delete r

How to query for relationships that connect two different nodes:

match(a)-[r]-(b) where id(a)<>id(b) return r

 

View solution in original post

1 REPLY 1

glilienfield
Ninja
Ninja

To delete relationships that refer to the same node:

match(a)-[r]-(a) delete r

How to query for relationships that connect two different nodes:

match(a)-[r]-(b) where id(a)<>id(b) return r