You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jo...@apache.org on 2021/10/20 18:12:27 UTC

[incubator-age-website] branch asf-site updated: Update Return Clause

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

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


The following commit(s) were added to refs/heads/asf-site by this push:
     new 8f3a9f7  Update Return Clause
8f3a9f7 is described below

commit 8f3a9f7a4e56f27428455793edafaa2fc99f7266
Author: Josh Innis <Jo...@gmail.com>
AuthorDate: Wed Oct 20 11:11:56 2021 -0700

    Update Return Clause
---
 docs/_sources/clauses/return.md.txt | 52 +++++++++++++++++++++++++++++++++++++
 docs/clauses/return.html            | 49 ++++++++++++++++++++++++++++++++++
 docs/searchindex.js                 |  2 +-
 docs/src/docs/clauses/return.md     | 52 +++++++++++++++++++++++++++++++++++++
 4 files changed, 154 insertions(+), 1 deletion(-)

diff --git a/docs/_sources/clauses/return.md.txt b/docs/_sources/clauses/return.md.txt
index 4d7ddb0..4ee2ea8 100644
--- a/docs/_sources/clauses/return.md.txt
+++ b/docs/_sources/clauses/return.md.txt
@@ -115,6 +115,58 @@ Result
 </table>
 
 
+## Return all elements
+
+When you want to return all vertices, edges and paths found in a query, you can use the * symbol.
+
+Query
+
+```
+SELECT *
+FROM cypher('graph_name', $$
+	MATCH (a {name: 'A'})-[r]->(b)
+	RETURN *
+$$) as (a agtype, b agtype, r agtype);
+```
+
+
+This returns the two vertices, and the edge used in the query.
+
+Result
+<table>
+  <thead>
+  <tr>
+   <td><strong>a</strong></td>
+   <td><strong>b</strong></td>
+   <td><strong>r</strong></td>
+  </tr>
+  </thead>
+  <tbody>
+  <tr>
+   <td>{"id": 281474976710659, "label": "", "properties": {"age": 55, "name": "A", "happy": "Yes!"}}::vertex 
+   </td>
+   <td>
+{"id": 1125899906842625, "label": "BLOCKS", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge
+   </td>
+   <td>
+{"id": 281474976710660, "label": "", "properties": {"name": "B"}}::vertex
+   </td>
+  </tr>
+  <tr>
+   <td>{"id": 281474976710659, "label": "", "properties": {"age": 55, "name": "A", "happy": "Yes!"}}::vertex 
+   </td>
+   <td>
+{"id": 1407374883553281, "label": "KNOWS", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge
+   </td>
+   <td>
+{"id": 281474976710660, "label": "", "properties": {"name": "B"}}::vertex
+   </td>
+  </tr>
+  <tbody>
+   <td>(2 rows)
+   </td>
+  </tr>
+</table>
 
 ## Variable with uncommon characters
 
diff --git a/docs/clauses/return.html b/docs/clauses/return.html
index b206854..bde7394 100644
--- a/docs/clauses/return.html
+++ b/docs/clauses/return.html
@@ -112,6 +112,7 @@
 <li class="toctree-l2"><a class="reference internal" href="#return-nodes">Return nodes</a></li>
 <li class="toctree-l2"><a class="reference internal" href="#return-edges">Return edges</a></li>
 <li class="toctree-l2"><a class="reference internal" href="#return-property">Return property</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#return-all-elements">Return all elements</a></li>
 <li class="toctree-l2"><a class="reference internal" href="#variable-with-uncommon-characters">Variable with uncommon characters</a></li>
 <li class="toctree-l2"><a class="reference internal" href="#aliasing-a-field">Aliasing a field</a></li>
 <li class="toctree-l2"><a class="reference internal" href="#optional-properties">Optional properties</a></li>
@@ -301,6 +302,54 @@ $$) as (name agtype);
   </tr>
 </table>
 </div>
+<div class="section" id="return-all-elements">
+<h2>Return all elements<a class="headerlink" href="#return-all-elements" title="Permalink to this headline">¶</a></h2>
+<p>When you want to return all vertices, edges and paths found in a query, you can use the * symbol.</p>
+<p>Query</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>SELECT *
+FROM cypher(&#39;graph_name&#39;, $$
+	MATCH (a {name: &#39;A&#39;})-[r]-&gt;(b)
+	RETURN *
+$$) as (a agtype, b agtype, r agtype);
+</pre></div>
+</div>
+<p>This returns the two vertices, and the edge used in the query.</p>
+<p>Result</p>
+<table>
+  <thead>
+  <tr>
+   <td><strong>a</strong></td>
+   <td><strong>b</strong></td>
+   <td><strong>r</strong></td>
+  </tr>
+  </thead>
+  <tbody>
+  <tr>
+   <td>{"id": 281474976710659, "label": "", "properties": {"age": 55, "name": "A", "happy": "Yes!"}}::vertex 
+   </td>
+   <td>
+{"id": 1125899906842625, "label": "BLOCKS", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge
+   </td>
+   <td>
+{"id": 281474976710660, "label": "", "properties": {"name": "B"}}::vertex
+   </td>
+  </tr>
+  <tr>
+   <td>{"id": 281474976710659, "label": "", "properties": {"age": 55, "name": "A", "happy": "Yes!"}}::vertex 
+   </td>
+   <td>
+{"id": 1407374883553281, "label": "KNOWS", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge
+   </td>
+   <td>
+{"id": 281474976710660, "label": "", "properties": {"name": "B"}}::vertex
+   </td>
+  </tr>
+  <tbody>
+   <td>(2 rows)
+   </td>
+  </tr>
+</table>
+</div>
 <div class="section" id="variable-with-uncommon-characters">
 <h2>Variable with uncommon characters<a class="headerlink" href="#variable-with-uncommon-characters" title="Permalink to this headline">¶</a></h2>
 <p>To introduce a placeholder that is made up of characters that are not contained in the English alphabet, you can use the ` to enclose the variable, like this:</p>
diff --git a/docs/searchindex.js b/docs/searchindex.js
index ea96e88..34f40b4 100644
--- a/docs/searchindex.js
+++ b/docs/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["advanced/advanced","advanced/advanced_overview","advanced/plpgsql","advanced/prepared_statements","clauses/create","clauses/delete","clauses/match","clauses/order_by","clauses/remove","clauses/return","clauses/set","clauses/with","functions/aggregate_functions","functions/list_functions","functions/logarithmic_functions","functions/numeric_functions","functions/predicate_functions","functions/scalar_functions","functions/string_functions","functions/trigonomet [...]
\ No newline at end of file
+Search.setIndex({docnames:["advanced/advanced","advanced/advanced_overview","advanced/plpgsql","advanced/prepared_statements","clauses/create","clauses/delete","clauses/match","clauses/order_by","clauses/remove","clauses/return","clauses/set","clauses/with","functions/aggregate_functions","functions/list_functions","functions/logarithmic_functions","functions/numeric_functions","functions/predicate_functions","functions/scalar_functions","functions/string_functions","functions/trigonomet [...]
\ No newline at end of file
diff --git a/docs/src/docs/clauses/return.md b/docs/src/docs/clauses/return.md
index 4d7ddb0..4ee2ea8 100644
--- a/docs/src/docs/clauses/return.md
+++ b/docs/src/docs/clauses/return.md
@@ -115,6 +115,58 @@ Result
 </table>
 
 
+## Return all elements
+
+When you want to return all vertices, edges and paths found in a query, you can use the * symbol.
+
+Query
+
+```
+SELECT *
+FROM cypher('graph_name', $$
+	MATCH (a {name: 'A'})-[r]->(b)
+	RETURN *
+$$) as (a agtype, b agtype, r agtype);
+```
+
+
+This returns the two vertices, and the edge used in the query.
+
+Result
+<table>
+  <thead>
+  <tr>
+   <td><strong>a</strong></td>
+   <td><strong>b</strong></td>
+   <td><strong>r</strong></td>
+  </tr>
+  </thead>
+  <tbody>
+  <tr>
+   <td>{"id": 281474976710659, "label": "", "properties": {"age": 55, "name": "A", "happy": "Yes!"}}::vertex 
+   </td>
+   <td>
+{"id": 1125899906842625, "label": "BLOCKS", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge
+   </td>
+   <td>
+{"id": 281474976710660, "label": "", "properties": {"name": "B"}}::vertex
+   </td>
+  </tr>
+  <tr>
+   <td>{"id": 281474976710659, "label": "", "properties": {"age": 55, "name": "A", "happy": "Yes!"}}::vertex 
+   </td>
+   <td>
+{"id": 1407374883553281, "label": "KNOWS", "end_id": 281474976710660, "start_id": 281474976710659, "properties": {}}::edge
+   </td>
+   <td>
+{"id": 281474976710660, "label": "", "properties": {"name": "B"}}::vertex
+   </td>
+  </tr>
+  <tbody>
+   <td>(2 rows)
+   </td>
+  </tr>
+</table>
 
 ## Variable with uncommon characters