MatheusFarias03 commented on issue #948:
URL: https://github.com/apache/age/issues/948#issuecomment-1619061800

   Hello @Leelst ! Although AGE doesn't have the `shortestPath` function, I 
believe you could have the expected result by executing the following query:
   ```sql
   SELECT * FROM cypher('graph_name', $$
   MATCH (v:Person {lastName: 'Beran'}), (v2:Person {lastName: 'Jones'}), 
p=((v)-[Knows*..15]-(v2))
   RETURN relationships(p) ORDER BY length(p) LIMIT 1
   $$) AS (shortestpath agtype);
   ``` 
   The `relationships()` function returns a list containing all the 
relationships in a path. Then you have to do `ORDER BY` to and limit it by 1 if 
you want to retrieve the shortest path.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to