This is an automated email from the ASF dual-hosted git repository.

dehowef pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age-website.git


The following commit(s) were added to refs/heads/master by this push:
     new a2cbe380 Added nodes() function in List Functions (#166)
a2cbe380 is described below

commit a2cbe38049b8abd47408044e53035726ac310aff
Author: Wendel de Lana <[email protected]>
AuthorDate: Mon Jul 17 16:06:11 2023 -0700

    Added nodes() function in List Functions (#166)
---
 docs/functions/list_functions.md | 58 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/docs/functions/list_functions.md b/docs/functions/list_functions.md
index 84a38a5a..ba12d0c1 100644
--- a/docs/functions/list_functions.md
+++ b/docs/functions/list_functions.md
@@ -200,6 +200,64 @@ Result:
   </tr>
 </table>
 
+## nodes
+
+nodes returns a list containing all the vertices in a path.
+
+Syntax:`nodes(path)`
+
+Returns:
+```
+An Agtype list containing vertex entities
+```
+
+Arguments:
+<table>
+  <tr>
+   <td>Name
+   </td>
+   <td>Description
+   </td>
+  </tr>
+  <tr>
+   <td>path
+   </td>
+   <td>An expression that returns an Agtype path.
+   </td>
+  </tr>
+</table>
+
+Considerations:
+* nodes(null) returns null.
+
+Query:
+```postgresql
+SELECT *
+FROM cypher('graph_name', $$
+       MATCH p = (a)-[]->(b)-[]->(c)
+       WHERE a.name = 'Alice' AND c.name = 'Eskil'
+       RETURN nodes(a)
+$$) as (vertices agtype);
+```
+
+A list containing all the vertices in the path p is returned.
+
+Result:
+<table>
+  <tr>
+   <td>vertices
+   </td>
+  </tr>
+  <tr>
+   <td> [{"id": 844424930131969, "label": "Person", "properties": {"age": 38, 
"eyes": "brown", "name": "Alice"}}::vertex, {"id": 844424930131970, "label": 
"Person", "properties": {"age": 25, "eyes": "blue", "name": "Bob"}}::vertex, 
{"id": 844424930131973, "label": "Person", "properties": {"age": 41, "eyes": 
"blue", "name": "Eskil", "array": ["one", "two", "three"]}}::vertex]
+   </td>
+  </tr>
+  <tr>
+   <td colspan="3" >1 row
+   </td>
+  </tr>
+</table>
+
 ## relationships
 
 relationships() returns a list containing all the relationships in a path.

Reply via email to