I have written the following query which returns all paths possible from the specified node.
g.V(<some_id>).repeat(bothE().bothV().simplePath()).emit().dedup().path()
If we had a simple graph of 3 nodes in this structure:
A -- edge_1 -> B -- edge_2 -> C
this query would return two paths:
A, edge_1, B
A, edge_1, B, edge_2, C
However, I only want to return all paths that terminate (i.e. there is no further nodes to traverse), which in this example would only return
A, edge_1, B, edge_2, C
Is this possible?
You can try to do the
repeat
without theemit
step and useuntil
to stop at the end of the path.example: https://gremlify.com/jqr8y7p24wb