I am running a Gremlin query against Neptune 1.1.1.0. For development purposes, I'm trying to remove a vertex with a specific phone number along with its related Subscription
and Channel
vertices. I have a union
statement that correctly emits the desired vertices in the Gremlin console, and I can apply elementMap()
to print out all the properties:
gremlin> g.V()
.hasLabel('Identity').has('phones', '+11234567890'))
.union(
identity(),
__.out('Receives').hasLabel('Subscription'),
__.out('MemberOf').hasLabel('Channel')
)
==>v[d5bc0f8a-a5a5-4209-8bbf-43ea1c39a694]
==>v[d0183e2b-74a8-446c-b378-903dcfc5f50f]
==>v[aba2577f-9244-4367-bcb6-209b9fbe4548]
gremlin> g.V()
.hasLabel('Identity').has('phones', '+11234567890'))
.union(
identity(),
__.out('Receives').hasLabel('Subscription'),
__.out('MemberOf').hasLabel('Channel')
).elementMap()
==> // prints out properties for each of the 3 vertices
However, if I apply drop()
to the query, the first (Identity
) vertex is dropped, but not the subsequent ones. I expected that when I had a traversal with multiple matching vertices, all of them would be dropped (e.g., g.V().hasLabel('Identity').has('phones', startingWith('+1')).drop()
drops all North American vertices). Why is Neptune/Gremlin stopping at the first vertex in this case?
gremlin> g.V()
.hasLabel('Identity').has('phones', '+11234567890'))
.union(
identity(),
__.out('Receives').hasLabel('Subscription'),
__.out('MemberOf').hasLabel('Channel')
).drop()
(I would generally attempt to run an explain
here to get more information, but I don't know how to make that work with drop()
as a final step.)