mohayu22 commented on issue #729:
URL: https://github.com/apache/age/issues/729#issuecomment-1455079759

   Path may look like a list but it is not the same thing as a list in cypher. 
Therefore, the head() function cannot be used directly on a path object. 
Instead, you can extract the vertices and edges from the path using the nodes() 
and relationships() functions respectively, and then apply the head() function 
to the resulting lists. For example, to get the first vertex and first edge of 
the path, you can modify your query like this:
   
   ```
   SELECT * FROM cypher('graph', $$
       MATCH p = (u {name : "A"})-[e: DISTANCE*]->(v {name : "C"})
       RETURN head(nodes(p)), head(relationships(p)) 
   $$) AS (res1 agtype, res2 agtype);
   ```
   
    
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to