user3677031
user3677031

Reputation: 21

Gremlin Repeat Until Returning Edges on path()

I am trying to come up with a gremlin query to find who is an employee and knows "Jack". I am interested as well on the path together with the edges to understand why they know each other

Here the representation of it enter image description here

Here is the query I come up with but no luck with getting the edges.

g.V().has('isSSEmployee',true).repeat(both().simplePath()).until(has('name','Jack')).path().limit(10)

Upvotes: 1

Views: 879

Answers (1)

Kelvin Lawrence
Kelvin Lawrence

Reputation: 14371

In order to have edges returned in the path result you need to specifically reference them in the query. Something like this:

g.V().has('isSSEmployee',true).repeat(bothE().otherV().simplePath()).until(has('name','Jack')).path().limit(10)

Hope that helps. Kelvin

Upvotes: 0

Related Questions