Reputation: 127
g.V().has('name', 'alice').both().both().cyclicPath().path().by('name')
Why we need 2 both()s to get the cyclicPath()?
Upvotes: 0
Views: 182
Reputation: 46226
It's not completely clear as to what you are asking but your traversal is simply translating to:
g.V().has('name', 'alice'). // (1)
both(). // (2)
both(). // (3)
cyclicPath(). // (4)
path().by('name') // (5)
simplePath()
which would filter out paths that cycle (i.e. go back to start).Upvotes: 3