Nodes with duplicate property value

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

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

Thanks a lot, it works