Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active October 12, 2021 18:59
Show Gist options
  • Save spmallette/f1016f239660c23601c98993a9dde13a to your computer and use it in GitHub Desktop.
Save spmallette/f1016f239660c23601c98993a9dde13a to your computer and use it in GitHub Desktop.
gremlin> g.inject(null).V().both().coalesce(has('name','marko').both(),constant(null)).cyclicPath().path()
==>[null,v[1],v[3],null]
==>[null,v[1],v[2],null]
==>[null,v[1],v[4],null]
==>[null,v[2],v[1],v[2]]
==>[null,v[3],v[1],v[3]]
==>[null,v[3],v[4],null]
==>[null,v[3],v[6],null]
==>[null,v[4],v[5],null]
==>[null,v[4],v[3],null]
==>[null,v[4],v[1],v[4]]
==>[null,v[5],v[4],null]
==>[null,v[6],v[3],null]
gremlin> g.inject(null).V().both().coalesce(has('name','marko').both(),constant(null)).simplePath().path()
==>[null,v[2],v[1],v[3]]
==>[null,v[2],v[1],v[4]]
==>[null,v[3],v[1],v[2]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment