There is a situation where I need to match any node label.
We can do this for relationship types such as
(n)-[:KNOWS|LOVES]->(m)
Is it possible to map node labels like this? eg.
MATCH (c:computer)<-[:belongs_to]-(comp:HP|IBM)
return comp
I have tried this currently and it gives results, is there an easier way?
MATCH (c:computer)<-[:belongs_to]-(comp)
WHERE 'HP' IN labels(comp) OR 'IBM' IN labels(comp)
return comp
source
share