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.

need suggestions for writing query

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

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

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