Skip to content

Instantly share code, notes, and snippets.

@okram
Created July 30, 2014 20:14
Show Gist options
  • Save okram/055eceb44d814267286c to your computer and use it in GitHub Desktop.
Save okram/055eceb44d814267286c to your computer and use it in GitHub Desktop.
gremlin> g = TinkerFactory.createClassic()
==>tinkergraph[vertices:6 edges:6]
gremlin> g.V.as('x').match('a', g.of().as('a').out.as('b'), g.of().as('b').out.as('c'))
==>[a:v[1], b:v[4], c:v[5]]
==>[a:v[1], b:v[4], c:v[3]]
gremlin> g.V.as('x').match('a', g.of().as('a').out.as('b'), g.of().as('b').out.as('c')).keep('a')
==>v[1]
==>v[1]
gremlin> g.V.as('x').match('a', g.of().as('a').out.as('b'), g.of().as('b').out.as('c')).keep('a','b')
==>[a:v[1], b:v[4]]
==>[a:v[1], b:v[4]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment