Skip to content

Commit 7e5f07d

Browse files
more
1 parent 2af1484 commit 7e5f07d

File tree

4 files changed

+51
-41
lines changed

4 files changed

+51
-41
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,26 @@
4040
** **Read/Write**
4141
** xref:clauses/merge.adoc[]
4242

43-
** **Procedure invocation**
43+
** **Invocation**
4444
** xref:clauses/call.adoc[]
45+
** xref:subqueries/call-subquery.adoc[]
46+
** xref:subqueries/subqueries-in-transactions.adoc[]
4547

4648
** **Import**
4749
** xref:clauses/load-csv.adoc[]
4850

4951
** **Graph selection**
5052
** xref:clauses/use.adoc[]
5153

54+
** **Schema**
55+
** xref:constraints/managing-constraints.adoc#create-constraint[CREATE CONSTRAINT]
56+
** xref:constraints/managing-constraints.adoc#list-constraints[SHOW CONSTRAINTS]
57+
** xref:constraints/managing-constraints.adoc#drop-constraint[DROP CONSTRAINTS]
58+
** xref:indexes/search-performance-indexes/managing-indexes.adoc#create-range-index[CREATE INDEX]
59+
** xref:indexes/search-performance-indexes/managing-indexes.adoc#list-indexes[SHOW INDEXES]
60+
** xref:indexes/search-performance-indexes/managing-indexes.adoc#drop-indexes[DROP INDEX]
61+
62+
5263
** **Metadata**
5364
** xref:clauses/listing-functions.adoc[]
5465
** xref:clauses/listing-procedures.adoc[]

modules/ROOT/pages/subqueries/collect.adoc

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ RETURN person.name as name,
6363
MATCH (person)-[r:HAS_DOG]->(dog:Dog)
6464
WHERE r.since > 2017
6565
RETURN dog.name
66-
} as youngDogs
66+
} AS youngDogs
6767
----
6868

6969
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -120,15 +120,14 @@ The below example shows the collection of pet names each person has by using a `
120120
[source, cypher]
121121
----
122122
MATCH (person:Person)
123-
RETURN
124-
person.name AS name,
125-
COLLECT {
126-
MATCH (person)-[:HAS_DOG]->(dog:Dog)
127-
RETURN dog.name AS petName
128-
UNION
129-
MATCH (person)-[:HAS_CAT]->(cat:Cat)
130-
RETURN cat.name AS petName
131-
} AS petNames
123+
RETURN person.name AS name,
124+
COLLECT {
125+
MATCH (person)-[:HAS_DOG]->(dog:Dog)
126+
RETURN dog.name AS petName
127+
UNION
128+
MATCH (person)-[:HAS_CAT]->(cat:Cat)
129+
RETURN cat.name AS petName
130+
} AS petNames
132131
----
133132

134133
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -154,10 +153,10 @@ In the example below, the outer variable `name` is shadowed and will therefore t
154153
WITH 'Peter' as name
155154
MATCH (person:Person {name: name})
156155
RETURN COLLECT {
157-
WITH 'Ozzy' AS name
158-
MATCH (person)-[r:HAS_DOG]->(d:Dog {name: name})
159-
RETURN d.name
160-
} as dogsOfTheYear
156+
WITH 'Ozzy' AS name
157+
MATCH (person)-[r:HAS_DOG]->(d:Dog {name: name})
158+
RETURN d.name
159+
} AS dogsOfTheYear
161160
----
162161

163162
.Error message
@@ -173,12 +172,13 @@ Note that the outer scope variable `person` referenced in the main query is stil
173172
[source, cypher]
174173
----
175174
MATCH (person:Person)
176-
RETURN person.name AS name, COLLECT {
177-
WITH 2018 AS yearOfTheDog
178-
MATCH (person)-[r:HAS_DOG]->(d:Dog)
179-
WHERE r.since = yearOfTheDog
180-
RETURN d.name
181-
} as dogsOfTheYear
175+
RETURN person.name AS name,
176+
COLLECT {
177+
WITH 2018 AS yearOfTheDog
178+
MATCH (person)-[r:HAS_DOG]->(d:Dog)
179+
WHERE r.since = yearOfTheDog
180+
RETURN d.name
181+
} AS dogsOfTheYear
182182
----
183183

184184
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -206,10 +206,10 @@ See a few examples below of how `COLLECT` can be used in different positions wit
206206
MATCH (person:Person)
207207
RETURN person.name,
208208
COLLECT {
209-
MATCH (person)-[:HAS_DOG]->(d:Dog)
210-
MATCH (d)-[:HAS_TOY]->(t:Toy)
211-
RETURN t.name
212-
} as toyNames
209+
MATCH (person)-[:HAS_DOG]->(d:Dog)
210+
MATCH (d)-[:HAS_TOY]->(t:Toy)
211+
RETURN t.name
212+
} AS toyNames
213213
----
214214

215215
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -230,7 +230,7 @@ RETURN person.name,
230230
MATCH (person:Person)
231231
WHERE person.name = "Peter"
232232
SET person.dogNames = COLLECT { MATCH (person)-[:HAS_DOG]->(d:Dog) RETURN d.name }
233-
RETURN person.dogNames as dogNames
233+
RETURN person.dogNames AS dogNames
234234
----
235235

236236
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -274,9 +274,10 @@ and then calculates the average age for each group.
274274
[source, cypher]
275275
----
276276
MATCH (person:Person)
277-
RETURN COLLECT { MATCH (person)-[:HAS_DOG]->(d:Dog)
278-
RETURN d.name } AS dogNames,
279-
avg(person.age) AS averageAge
277+
RETURN COLLECT {
278+
MATCH (person)-[:HAS_DOG]->(d:Dog)
279+
RETURN d.name } AS dogNames,
280+
avg(person.age) AS averageAge
280281
ORDER BY dogNames
281282
----
282283

modules/ROOT/pages/subqueries/count.adoc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ MATCH (person:Person)
125125
RETURN
126126
person.name AS name,
127127
COUNT {
128-
MATCH (person)-[:HAS_DOG]->(dog:Dog)
129-
RETURN dog.name AS petName
130-
UNION
131-
MATCH (person)-[:HAS_CAT]->(cat:Cat)
132-
RETURN cat.name AS petName
128+
MATCH (person)-[:HAS_DOG]->(dog:Dog)
129+
RETURN dog.name AS petName
130+
UNION
131+
MATCH (person)-[:HAS_CAT]->(cat:Cat)
132+
RETURN cat.name AS petName
133133
} AS numPets
134134
----
135135

@@ -205,8 +205,8 @@ See a few examples below:
205205
[source, cypher]
206206
----
207207
MATCH (person:Person)
208-
RETURN person.name, COUNT { (person)-[:HAS_DOG]->(:Dog) } as howManyDogs
209-
208+
RETURN person.name,
209+
COUNT { (person)-[:HAS_DOG]->(:Dog) } AS howManyDogs
210210
----
211211

212212
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -229,7 +229,6 @@ MATCH (person:Person)
229229
WHERE person.name ="Andy"
230230
SET person.howManyDogs = COUNT { (person)-[:HAS_DOG]->(:Dog) }
231231
RETURN person.howManyDogs as howManyDogs
232-
233232
----
234233

235234
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -252,7 +251,6 @@ RETURN
252251
WHEN COUNT { (person)-[:HAS_DOG]->(:Dog) } > 1 THEN "Doglover " + person.name
253252
ELSE person.name
254253
END AS result
255-
256254
----
257255

258256
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -278,7 +276,6 @@ MATCH (person:Person)
278276
RETURN COUNT { (person)-[:HAS_DOG]->(:Dog) } AS numDogs,
279277
avg(person.age) AS averageAge
280278
ORDER BY numDogs
281-
282279
----
283280

284281
[role="queryresult",options="header,footer",cols="2*<m"]

modules/ROOT/pages/subqueries/existential.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ Here the result is a boolean that shows whether the subquery can find the given
152152
[source, cypher]
153153
----
154154
MATCH (person:Person)
155-
RETURN person.name AS name, EXISTS {
156-
MATCH (person)-[:HAS_DOG]->(:Dog)
155+
RETURN person.name AS name,
156+
EXISTS {
157+
MATCH (person)-[:HAS_DOG]->(:Dog)
157158
} AS hasDog
158159
----
159160

0 commit comments

Comments
 (0)