Skip to content

Instantly share code, notes, and snippets.

@spmallette
Last active November 26, 2021 19:02
Show Gist options
  • Save spmallette/a6bb3e857ef39ae83a2d358a0eaca9c0 to your computer and use it in GitHub Desktop.
Save spmallette/a6bb3e857ef39ae83a2d358a0eaca9c0 to your computer and use it in GitHub Desktop.
gremlin> g.V().coalesce(out(),fail('vertex has no out edges'))
==>v[3]
==>v[2]
==>v[4]
fail() Step Triggered
===========================================================
Message > vertex has no out edges
Traverser> v[2]
Bulk > 1
Traversal> fail()
Parent > CoalesceStep [.V().coalesce(__.out(),__.fail())]
Metadata > [:]
===========================================================
gremlin> g.withSideEffect('x',100).V().as('a').out().coalesce(out(),fail('vertex has no out edges'))
fail() Step Triggered
=======================================================================================================
Message > vertex has no out edges
Traverser> v[3]
Bulk > 1
Sack > null
Loops > [[null:0]]
S/E > [x:100]
Traversal> fail()
Parent > CoalesceStep [.withSideEffect("x",(int) 100).V().as("a").out().coalesce(__.out(),__.fail())]
Metadata > [:]
=======================================================================================================
gremlin> g.withSideEffect('x',100).withPath().V().as('a').out().coalesce(out(),fail('vertex has no out edges'))
fail() Step Triggered
==================================================================================================================
Message > vertex has no out edges
Traverser> v[3]
Bulk > 1
Sack > null
Path > path[v[1], v[3]]
Loops > [[null:0]]
S/E > [x:100]
Traversal> fail()
Parent > CoalesceStep [.withSideEffect("x",(int) 100).withPath().V().as("a").out().coalesce(__.out(),__.fail())]
Metadata > [:]
==================================================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment