You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -101,11 +107,13 @@ This will improve performance.
101
107
To return all nodes, relationships and paths found in a query, use the `*` symbol:
102
108
103
109
.Query
110
+
// tag::clauses_return_all_elements[]
104
111
[source, cypher]
105
112
----
106
113
MATCH p = (keanu:Person {name: 'Keanu Reeves'})-[r]->(m)
107
114
RETURN *
108
115
----
116
+
// end::clauses_return_all_elements[]
109
117
110
118
This returns the two nodes, and the two possible paths between them.
111
119
@@ -149,11 +157,13 @@ d|Rows: 1
149
157
Names of returned columns can be renamed using the `AS` operator:
150
158
151
159
.Query
160
+
// tag::clauses_return_with_column_alias[]
152
161
[source, cypher]
153
162
----
154
163
MATCH (p:Person {name: 'Keanu Reeves'})
155
164
RETURN p.nationality AS citizenship
156
165
----
166
+
// end::clauses_return_with_column_alias[]
157
167
158
168
Returns the `nationality` property of `'Keanu Reeves'`, but the column is renamed to `citizenship`.
159
169
@@ -220,11 +230,13 @@ Returns a predicate, a literal and function call with a pattern expression param
220
230
`DISTINCT` retrieves only unique rows for the columns that have been selected for output.
221
231
222
232
.Query
233
+
// tag::clauses_return_distinct[]
223
234
[source, cypher]
224
235
----
225
236
MATCH (p:Person {name: 'Keanu Reeves'})-->(m)
226
237
RETURN DISTINCT m
227
238
----
239
+
// end::clauses_return_distinct[]
228
240
229
241
The `Movie` node `'Man of Tai Chi'` is returned by the query, but only once (without the `DISTINCT` operator it would have been returned twice because there are two relationships going to it from `'Keanu Reeves'`):
0 commit comments