Trying to get all nodes of a certain label type. I have roots of multiple graphs that all have the same suffix in their labels. For example, i have 3 nodes that all have treeroot
at the end of their label. So I might have companytreeroot
, buildingtreeroot
, nd employeetreeroot
as 3 valid labels for 3 distinct nodes. How would I get all nodes whose label has that pattern?
I tried:
match (n) where '.*treeroot' in labels(n) return n
and
match (n) where 'treeroot' in labels(n) return n
but both return empty sets...
You can use ANY function
for apply reqular expression to labels:
match (n) where ANY(l in labels(n) WHERE l =~ ".*treeroot")
return n
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