Duplicity finding - query which was correct in the past, fails now

I have used following query for identifying duplicities

MATCH (p:Case)
WITH p.name as name, collect(p) AS nodes
WHERE size(nodes) > 1
WITH nodes ORDER BY size(nodes) DESC
LIMIT 1
UNWIND nodes AS n
RETURN n.name, id(n) AS internalId, size((n)--()) AS rels
ORDER BY rels DESC

Query run correctly in the past, but now is not possible to use size((n)--()) ...rest of the query is fine.

Could somebody advice me why and how to use it correctly now ?

Kind Regards

Vaclav

Are you using 5.x? If so, use this instead.

count{(n)--()}

From the 5.0 release notes:

Screen Shot 2022-12-21 at 2.09.00 PM.png

https://neo4j.com/release-notes/database/neo4j-5/