Re: Deleting Vertex

9 views
Skip to first unread message

Andy Tolbert

unread,
Mar 15, 2018, 9:54:08 AM3/15/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi gw,

As you indicate, vertices/edges returned from traversals with DSE Graph are detached.  You can remove vertices and edges using the Drop step in your traversal, i.e., I would expect the following to work:

traversal.V().hasLabel('my-vertex').has('my-vertex-id', id).drop()

Thanks,
Andy

On Wed, Mar 14, 2018 at 4:13 PM, gw <georg...@gmail.com> wrote:
I am converting existing TitanDB app to use DSE Graph.  One of the functionality pieces deletes vertices using TinkerPop Traversal.  It works just fine in the legacy code running against TitanDB, but generates exceptions when executing agains DSE graph.  This is because traversal returns detached vertex, which does not support removal directly.  What is the proper way to remove a Vertex obtained from traversal?  

I am using dse-java-driver-graph 1.5.1 and Apache gremlin-driver 3.2.5

Here is how I've been attempting to remove a vertex using traversal:

traversal.V().hasLabel('my-vertex').has('my-vertex-id', id).next().remove()


Any hints would be greatly appreciated!

Cheers,
~gw

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

gw

unread,
Mar 15, 2018, 10:02:05 AM3/15/18
to DataStax Java Driver for Apache Cassandra User Mailing List

It turns out that the legacy app ran TitanDB in embedded mode and it did not cause problems for removal of nodes because all graph objects were direct references vs. detached.

Thanks again!
~gw

Reply all
Reply to author
Forward
0 new messages