Assume that I have these nodes and relationships already persisted in DB:
3 > 5 > 9 > 8 > 0
When 3 > 5 > 9 is given as a parameter (as a vertex list), I’d like to write a GSQL function that return node 8. So basically a function that returns the subsequent node given a matching-subset of previous nodes.
I was looking around in the tutorials for a while (on SELECT statements, ACCUM, etc… ), but couldn’t find a solid solution.
Idea here is to get the next node given a lineage of nodes that happened to the subset of the parent node list that’s persisted in DB. I understand that there are edge-cases, like what happens if there’s always no match, etc… For now, let’s not worry too much about those edge-cases - I’m pretty sure I can resolve those on my own later on.