The path is representing for users' browse history.
I'm considering which design structure should I take.
For example,
the red path means the user has browsed
[page A]-> [page B]-> [page B]-> [page C]-> [page B]-> [page A]
the blue path means the user has browsed
[page C]-> [page D]-> [page A]
If I want to select whose browse path is page C earlier than page A ,
The answer should be blue path
How could I design the query in cypher query ,
Which design is suitable for my case?
Thank you.
design 1 (each path share the same nodes)
design 2 (each path should has its own nodes.)
UPDATE
I tried to apply your query in my model,
I want to know if the node 5231 is before than node 7222
But it couldn't get any output.
MATCH p=(x)-[*0..]->(y {code: '5231'})
WHERE NOT ()-->(x)
RETURN p
ORDER BY LENGTH(p)
LIMIT 1;