Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I check if a node has a label?

I didn’t fid a way how to check if a node has a label. I’ve found the documentation for HasLabel but this is related to graph output and visualization (https://memgraph.com/docs/data-visualization/graph-style-script/built-in-elements#haslabelnode-label). I need it for my Cypher query.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I think you can use label.exists function.

Query will look like:

MATCH (n) WHERE label.exists(n, "Person") RETURN n;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading