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.

Nodes with duplicate property value

starz10de
Node Clone

I have a graph where each node contains two property A and B. I wanted to check e.g., if the same B value exist in other nodes (appear in the data more than one time). So far I succeed to find the occurrence of the property B value when its more than once in the data.

here is my code:

MATCH (n:data)
WITH n.b as b, COUNT(n) as count 
WHERE count>1
RETURN b, count

However, I want also to return a for each b that appears more than one time

1 ACCEPTED SOLUTION

Hi @starz10de ,

Something like this should work

MATCH (n:data)
WITH n.b as b, collect(n) as li
WITH b, li
WHERE size(li)>1
RETURN b, li

Bennu

Oh, y’all wanted a twist, ey?

View solution in original post

2 REPLIES 2

Hi @starz10de ,

Something like this should work

MATCH (n:data)
WITH n.b as b, collect(n) as li
WITH b, li
WHERE size(li)>1
RETURN b, li

Bennu

Oh, y’all wanted a twist, ey?

Thanks a lot, it works