0

My NebulaGraph database version is v3.0.1. When I use graph database, I want to check a vertex has certain tag.

I has tried the queries as below, but can't get the right way.

FETCH PROP ON tagName 'vid' YIELD vertex AS node

I want to know whether a vertex has certain tag.

Q Steam
  • 1
  • 5
  • This is actually an intresting question(that I had never been thinking about it before) thanks :) – Wey Gu Dec 13 '22 at 08:36

1 Answers1

0

Try this:

MATCH (v:tagA)
  WHERE id(v) == "foo"
RETURN "tagA" IN tags(v) AS isTaggedTagA;

example:

(root@nebula) [basketballplayer]>
MATCH (v:player)
  WHERE id(v) == "player100"
RETURN "player" IN tags(v) AS isTaggedPlayer;
+----------------+
| isTaggedPlayer |
+----------------+
| true           |
+----------------+
Wey Gu
  • 575
  • 1
  • 6
  • 11