Make the find actor path query a little more succinct.
(And more importantly, this appears to work in kuzu v0.9.0 where the other did not.) FossilOrigin-Name: c1e6439201139141d0746577a70fb21ec1aee39247a9d12cc1ff81e6b572e84a
This commit is contained in:
parent
c46d76ea4a
commit
29469dc9d4
2 changed files with 1 additions and 5 deletions
|
|
@ -16,7 +16,6 @@ import
|
|||
std/math,
|
||||
std/os,
|
||||
std/sequtils,
|
||||
std/strutils,
|
||||
std/strformat
|
||||
import kuzu
|
||||
|
||||
|
|
@ -56,9 +55,7 @@ if res.getNext[0].toInt64 < 1:
|
|||
quit 1
|
||||
|
||||
stmt = conn.prepare """
|
||||
MATCH (a:Actor {name:$fromActor})
|
||||
MATCH (b:Actor {name:$toActor})
|
||||
MATCH path = (a)-[r:ActedIn* ALL SHORTEST]-(b)
|
||||
MATCH path = (a:Actor {name:$fromActor})-[r:ActedIn* ALL SHORTEST]-(b:Actor {name:$toActor})
|
||||
RETURN DISTINCT nodes(path) AS nodes, length(path) AS hops
|
||||
ORDER BY hops
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue