waleedahmed0001 commented on issue #939: URL: https://github.com/apache/age/issues/939#issuecomment-1555874624
To delete an edge, use the match clause to find your edges, then add the variable to the DELETE. ``` SELECT * FROM cypher('graph_name', $$ MATCH (n {name: 'Andres'})-[r:KNOWS]->() DELETE r $$) as (v agtype); ``` The above query will just delete the relationship or edge while the vertex will remain there. But we use the detach delete command to delete the edges first associated with a vertex and then the vertex would be deleted. ``` SELECT * FROM cypher('graph_name', $$ MATCH (v:Useless) DETACH DELETE v $$) as (v agtype); ``` So, there is no chance that vertex will be deleted directly by deleting the edges because vertex cannot be deleted if it has vertices attached with it using the delete command only. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@age.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org