Multiple EDGEs

DELETE EDGE serve "player100" -> "team200"@0;

Is it possible to delete ALL “player100” → “team200” edges (rank:0, rank:1, …)?

Second question: This docs:

https://docs.nebula-graph.io/2.0/3.ngql-guide/13.edge-statements/1.insert-edge/
// Only the last write can be read

Does nebula graph store the multiple-inserted EDGE multiple times (and only the last can be read) or does the insert-statement overwrite an existing EDGE?

@doublemax What version of Nebula Graph are you using?

Nebula 2 (due string keys) on CentOS

@doublemax Thanks for the reply.

For the 1st question, if you are trying to delete all incoming and outgoing edges of a vertex, you may try the “DELETE VERTEX” statement.


See:
https://docs.nebula-graph.io/2.0/3.ngql-guide/13.edge-statements/4.delete-edge/

For the 2nd question, should be overwritten. @critical27 Please confirm. The documentation is not clear about this.

Sorry, the first question was unclear. The docs says:

rank is optional. It specifies the edge rank of the same edge type. If not specified, the default value is 0. You can insert many edges with the same edge type for two vertices by using different rank values.
INSERT EDGE - Nebula Graph Database Manual

You have 2 edges:
“player1” → “team1” @1
“player1” → “team1” @2
How to delete @1 + @2 + … (or how to delete an edge without knowing the rank)?

Best wishes!

Try this like the example?:
nebula> GO FROM "player100" OVER follow WHERE follow._dst == "team200" YIELD follow._src AS src, follow._dst AS dst, follow._rank AS rank | \ DELETE EDGE follow $-.src->$-.dst @ $-.rank;
combine the delete with the pipe operator

1 Like