Search code examples
databasegraphgremlinedgesvertices

How do I drop an edge when I know the parent and child vertices?


I would like to do a drop() in an edge but the information I have is the parent and the child vertices.

What makes me sense is something like this:

g.E().outV('123').inV('456').drop()

or

g.E().has('outV', '123').has('inV', '456').drop()

but it doesn't seem to work. I know another way to do this query but it would be in several queries and I want to do it in a single one. On the Internet, I found nothing that could help me.^ Thanks for the help!


Solution

  • You can find the edge from the parent and drop it:

    g.V('123').outE().where(inV().hasId('456')).drop()
    

    this query will drop any edge between vertex '123' to vertex '456'.