How do you detach a tag from a vertex in Nebula Graph?

151 views Asked by At

I have a vertex that has properties from two tags assigned:

> match (x:t1) where id(x) == '2' return x
+--------------------------------------+
| x                                    |
+--------------------------------------+
| ("2" :t3{age: 20} :t1{name: "John"}) |
+--------------------------------------+
Got 1 rows (time spent 4141/99503 us)

If I just set t3 properties to null, they still hang there as nulls:

> update vertex '2' set t3.age = null
Execution succeeded (time spent 3938/121345 us)

> match (x:t1) where id(x) == '2' return x
+--------------------------------------------+
| x                                          |
+--------------------------------------------+
| ("2" :t3{age: __NULL__} :t1{name: "John"}) |
+--------------------------------------------+
Got 1 rows (time spent 4054/199559 us)

How do I detach a tag from this vertex completely?

1

There are 1 answers

0
Wey Gu On BEST ANSWER

update 2022-Dec-05: new update since 3.3.0

  • after 3.3.0 the bare vertex(without tag) is switched off by default(you could enable it with configuration), thus, it's same behavior as it was in 2.6 by default.

update 2022-Jan-22: it's supported now

  • in 2.6, deleting tag from a VID(with only one tag) will delete the vertex, too.
  • while after 3.0, bare vertex(without tag) is allowed, thus, delete tag won't delete vertex anymore.
DELETE TAG <tag_name_list> FROM <VID>;

ref:


Thank you for the exploration of the nebula graph ;).

As I know, there is no detach tag for now, the mitigation now is only to delete the vertex and insert it with the same vid with only one tag: t1.

An issue was raised here.

BR//Wey