Star

How to delete a piece of data in a [tag]

First, I created a tag:

CREATE TAG player(name string, age int);

and then three pieces of data were inserted

INSERT VERTEX player(name, age) VALUES 100:("Tim Duncan", 42);
INSERT VERTEX player(name, age) VALUES 101:("Tony Parker", 36);
INSERT VERTEX player(name, age) VALUES 102:("LaMarcus Aldridge", 33);

but how to delete one of the data,such as delete Tony Parker from player tag.

try
delete VERTEX 101

INSERT VERTEX person(name,birth) VALUES 101:(“Tony Parker”, “1984-01-01”);
INSERT VERTEX player(name, age) VALUES 101:(“Tony Parker”, 36);
if I execute delete VERTEX 101,If I execute [delete vertex 101], will these two data be deleted?I just want delete player but not delete person

Yes, both will be deleted. It seems we have not supported delete a tag from a vertex for now.

if you don’t care the vertex id, use hash is good way to work around this

INSERT VERTEX person(name,birth) VALUES hash(“person.Tony Parker”):(“Tony Parker”, “1984-01-01”);

FETCH PROP ON person hash(“person.Tony Parker”)

delete VERTEX hash(“person.Tony Parker”)

FETCH PROP ON person hash(“person.Tony Parker”)

Will this feature be supported in the future? I think it’s necessary to implement this feature

It may be possible, but I don’t think it’s a good solution

It seems like a meaningful feature. Would you please commit an issue for this feature?
https://github.com/vesoft-inc/nebula/issues

I’ve already submitted it

浙ICP备20010487号