Adjust shortest path query to use Memgraph's ASP function

This commit is contained in:
Maciej Pędzich 2024-07-27 18:55:45 +02:00
parent 36265e86b5
commit 5084dd49e9
Signed by: maciejpedzich
GPG Key ID: CE4A303D84882F0D

View File

@ -22,7 +22,7 @@ export async function getShortestPaths(source: string, dest: string) {
WHERE WHERE
(s.forename + " " + s.surname) = $source (s.forename + " " + s.surname) = $source
AND (d.forename + " " + d.surname) = $dest AND (d.forename + " " + d.surname) = $dest
MATCH path = allShortestPaths((s)-[*..20]-(d)) MATCH path = (s)-[:WAS_TEAMMATES_WITH *ALLSHORTEST (r, n | 1)]-(d)
RETURN path;`, RETURN path;`,
{ source, dest } { source, dest }
); );