Newer version of Cypher no longer likes my OPTIONAL MATCH clause. What is the correct version of this query for Cypher 2.1?
Cannot add labels or properties on a node which is already bound (line 1, column 104)
"MATCH (n1:Entity {key:"bloomberg michael"})-[r1:RELATED_TO]-(n2:Entity)
WITH n1, r1, n2
OPTIONAL MATCH (n2:Entity)-[r2:RELATED_TO]-(n3:Entity)
RETURN n1, r1, n2, count(n3), labels(n1), labels(n2)
ORDER BY n2.relevance DESC
LIMIT 50"
Can you try
MATCH (n1:Entity {key:"bloomberg michael"})-[r1:RELATED_TO]-(n2:Entity)
WITH n1, r1, n2
OPTIONAL MATCH (n2)-[r2:RELATED_TO]-(n3:Entity)
RETURN n1, r1, n2, count(n3), labels(n1), labels(n2)
ORDER BY n2.relevance DESC
LIMIT 50
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With