Skip to content

Commit 2393765

Browse files
Standardise null, true, false formatting (#1270)
1 parent ea40bb9 commit 2393765

22 files changed

+261
-261
lines changed

modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The below table is instead listed in order of their appearance in the link:https
2626
| xref:values-and-types/property-structural-constructed.adoc#property-types[Property types], xref:values-and-types/property-structural-constructed.adoc#type-synonyms[Types and their synonyms].
2727
| Includes: `BOOLEAN` (`BOOL`), `FLOAT`, `INTEGER` (`SIGNED INTEGER`, `INT`), and `STRING` (`VARCHAR`).
2828

29-
Cypher supports the boolean type predicate for `TRUE`, `FALSE`, and `NULL` but does not support the GQL keyword `UNKNOWN`.
29+
Cypher supports the boolean type predicate for `true`, `false`, and `null` but does not support the GQL keyword `UNKNOWN`.
3030

3131
| 9.1
3232
| <nested procedure specification>
@@ -138,7 +138,7 @@ This is currently not available in Cypher.
138138

139139
| 19.5
140140
| <null predicate>
141-
| xref:expressions/predicates/type-predicate-expressions.adoc#type-predicate-null[Type predicate expressions for `NULL`]
141+
| xref:expressions/predicates/type-predicate-expressions.adoc#type-predicate-null[Type predicate expressions for `null`]
142142
|
143143

144144
| 19.6
@@ -170,8 +170,8 @@ In Cypher, current user details can be seen using the link:{neo4j-docs-base-uri}
170170
| 20.9
171171
| <aggregate function>
172172
| xref:functions/aggregating.adoc#functions-avg[`avg()`], xref:functions/aggregating.adoc#functions-count[`count()`], xref:functions/aggregating.adoc#functions-max[`max`], xref:functions/aggregating.adoc#functions-mind[`min()`], xref:functions/aggregating.adoc#functions-sum[`sum()`]
173-
| Cypher and GQL handle `NULL` values differently for the `sum()` function when queries return 0 rows.
174-
For example, `RETURN sum(<expr>)` on an empty table returns `NULL` in GQL, but in Cypher it returns `0`.
173+
| Cypher and GQL handle `null` values differently for the `sum()` function when queries return 0 rows.
174+
For example, `RETURN sum(<expr>)` on an empty table returns `null` in GQL, but in Cypher it returns `0`.
175175

176176
| 20.11
177177
| <property reference>

modules/ROOT/pages/appendix/gql-conformance/supported-optional.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ GQL also defines a parameterless version of the function not in Cypher: `CURRENT
208208
|
209209

210210
| GV70
211-
| Immaterial value types: null type support (`NULL`)
212-
| xref:values-and-types/working-with-null.adoc[Working with `NULL`]
211+
| Immaterial value types: null type support (`null`)
212+
| xref:values-and-types/working-with-null.adoc[Working with `null`]
213213
|
214214

215215
| GV71

modules/ROOT/pages/clauses/with.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ ORDER BY price
256256
|===
257257
| product | price | isAffordable | discountCategory
258258

259-
| "Chocolate" | 5 | TRUE | 'Budget'
260-
| "Coffee" | 10 | TRUE | 'Budget'
261-
| "Headphones" | 250 | TRUE | 'Budget'
262-
| "Phone" | 500 | FALSE | 'High-end'
263-
| "Laptop" | 1000 | FALSE | 'High-end'
259+
| "Chocolate" | 5 | true | 'Budget'
260+
| "Coffee" | 10 | true | 'Budget'
261+
| "Headphones" | 250 | true | 'Budget'
262+
| "Phone" | 500 | false | 'High-end'
263+
| "Laptop" | 1000 | false | 'High-end'
264264

265265
4+d|Rows: 5
266266
|===
@@ -395,9 +395,9 @@ RETURN c.firstName AS customer,
395395
|===
396396
| customer | totalSpent | topSpender
397397

398-
| "Mateo" | 1015 | TRUE
399-
| "Amir" | 1005 | TRUE
400-
| "Yusuf" | 1005 | TRUE
398+
| "Mateo" | 1015 | true
399+
| "Amir" | 1005 | true
400+
| "Yusuf" | 1005 | true
401401

402402
3+d|Rows: 3
403403
|===
@@ -423,10 +423,10 @@ RETURN c.firstName AS customer,
423423
|===
424424
| customer | totalSpent | topSpender
425425

426-
| "Leila" | 1000 | FALSE
427-
| "Niko" | 760 | FALSE
428-
| "Hannah" | 260 | FALSE
429-
| "Keisha" | 250 | FALSE
426+
| "Leila" | 1000 | false
427+
| "Niko" | 760 | false
428+
| "Hannah" | 260 | false
429+
| "Keisha" | 250 | false
430430

431431
3+d|Rows: 4
432432
|===

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ Changes to the visibility of databases hosted on offline servers.
21402140

21412141
For such databases:
21422142

2143-
* The `address` column will return `NULL`.
2143+
* The `address` column will return `null`.
21442144
* The `currentStatus` column will return `unknown`.
21452145
* The `statusMessage` will return `Server is unavailable`.
21462146

modules/ROOT/pages/expressions/list-expressions.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ RETURN 3 IN nestedList[0] AS elementPresent
167167
|===
168168

169169

170-
Attempting to reference an element outside the bounds of the `LIST` will return `NULL`, as will attempting to access elements from an empty `LIST`.
170+
Attempting to reference an element outside the bounds of the `LIST` will return `null`, as will attempting to access elements from an empty `LIST`.
171171

172172
.Out-of-bounds and empty `LIST` access
173173
[source, cypher]
@@ -181,7 +181,7 @@ RETURN list[5] AS outOfBound, emptyList[0] AS emptyAccess
181181
|===
182182
| outOfBound | emptyAccess
183183

184-
| NULL | NULL
184+
| null | null
185185

186186
2+d|Rows: 1
187187
|===
@@ -340,9 +340,9 @@ RETURN cecil.skills || cecilia.skills AS combinedSkills
340340
1+d|Rows: 1
341341
|===
342342

343-
If `NULL` is part of a concatenated `LIST`, `NULL` will be a part of the new `LIST`.
343+
If `null` is part of a concatenated `LIST`, `null` will be a part of the new `LIST`.
344344

345-
.Concatenate `LIST` including `NULL`
345+
.Concatenate `LIST` including `null`
346346
[source, cypher]
347347
----
348348
RETURN [1, 2] || [3, null] AS listWithNull
@@ -353,12 +353,12 @@ RETURN [1, 2] || [3, null] AS listWithNull
353353
|===
354354
| listWithNull
355355

356-
| [1, 2, 3, NULL]
356+
| [1, 2, 3, null]
357357

358358
1+d|Rows: 1
359359
|===
360360

361-
For removing `NULL` values when concatenating `LIST` values, see xref:expressions/list-expressions.adoc#null-list-concatenation-list-comprehension[`NULL`, list concatenation, and list comprehension].
361+
For removing `null` values when concatenating `LIST` values, see xref:expressions/list-expressions.adoc#null-list-concatenation-list-comprehension[`null`, list concatenation, and list comprehension].
362362

363363
[[add-elements]]
364364
== Add elements to a list
@@ -562,9 +562,9 @@ RETURN [person IN collect(p) WHERE 'Python' IN person.skills | person.name] AS p
562562
1+d|Rows: 1
563563
|===
564564

565-
List comprehension can be used to remove any unknown `NULL` values when concatenating `LIST` values.
565+
List comprehension can be used to remove any unknown `null` values when concatenating `LIST` values.
566566

567-
.List comprehension to remove `NULL` values during list concatenation
567+
.List comprehension to remove `null` values during list concatenation
568568
// tag::expressions_list_comprehension_concatenation_remove_null[]
569569
[source, cypher]
570570
----

modules/ROOT/pages/expressions/map-expressions.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ RETURN p[dynamicValue] AS names
228228
1+d|Rows: 2
229229
|===
230230

231-
Referencing a non-existent key in the `MAP` with the `[]` operator will return `NULL`.
231+
Referencing a non-existent key in the `MAP` with the `[]` operator will return `null`.
232232

233233
.Dynamically referencing a non-existent `MAP` key
234234
[source, cypher]
@@ -243,7 +243,7 @@ RETURN map[dynamicKey] AS dynamicValue
243243
|===
244244
| dynamicValue
245245

246-
| NULL
246+
| null
247247

248248
1+d|Rows: 1
249249
|===
@@ -271,7 +271,7 @@ mapVariable {mapElement [, ...n]}
271271

272272
[NOTE]
273273
The key names in a map must be of type `STRING`. +
274-
If `mapVariable` is `NULL`, the projection evaluates to `NULL`.
274+
If `mapVariable` is `null`, the projection evaluates to `null`.
275275

276276
.Map projection with a key selector
277277
=====

modules/ROOT/pages/expressions/node-relationship-operators.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ RETURN p[$propertyName] AS middleName
133133

134134
| "Catherine"
135135
| "David"
136-
| NULL
136+
| null
137137

138138
1+d|Rows: 3
139139
|===
140140

141-
== Handling `NULL` values
141+
== Handling `null` values
142142

143-
If a property (or property value) is missing in an expression that uses tries to access a property statically or dynamically, the whole expression will evaluate to `NULL`.
143+
If a property (or property value) is missing in an expression that uses tries to access a property statically or dynamically, the whole expression will evaluate to `null`.
144144
The query below performs a xref:expressions/string-operators.adoc[string concatentation] on the `firstName`, `middleName`, and `lastName` properties on `Person` nodes.
145-
Note that `NULL` is returned for `Cecilia`, who lacks a `middleName` property.
145+
Note that `null` is returned for `Cecilia`, who lacks a `middleName` property.
146146

147147
.String concatenation using node properties
148148
[source, cypher]
@@ -158,15 +158,15 @@ RETURN p.firstName || ' ' || p.middleName || ' ' || p.lastName AS fullName
158158

159159
| "Alice Catherine Baxter"
160160
| "Cecil David Ericson"
161-
| NULL
161+
| null
162162

163163
1+d|Rows: 3
164164
|===
165165

166-
The xref:functions/scalar.adoc#functions-coalesce[`coalesce()`] function can be used to skip the first `NULL` values in an expression.
167-
In the below example, it replaces the first `NULL` value found with an empty `STRING`.
166+
The xref:functions/scalar.adoc#functions-coalesce[`coalesce()`] function can be used to skip the first `null` values in an expression.
167+
In the below example, it replaces the first `null` value found with an empty `STRING`.
168168

169-
.Use the `coalesce()` function to skip `NULL` values
169+
.Use the `coalesce()` function to skip `null` values
170170
// tag::expressions_node_relationship_operators_null[]
171171
[source, cypher]
172172
----

modules/ROOT/pages/expressions/predicates/boolean-operators.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ Cypher contains the following boolean operators:
1414
[options="header", cols="^,^,^,^,^,^", width="85%"]
1515
|===
1616
|a | b | a `AND` b | a `OR` b | a `XOR` b | `NOT` a
17-
|`FALSE` | `FALSE` | `FALSE` | `FALSE` | `FALSE` | `TRUE`
18-
|`FALSE` | `NULL` | `FALSE` | `NULL` | `NULL` | `TRUE`
19-
|`FALSE` | `TRUE` | `FALSE` | `TRUE` | `TRUE` | `TRUE`
20-
|`TRUE` | `FALSE` | `FALSE` | `TRUE` | `TRUE` | `FALSE`
21-
|`TRUE` | `NULL` | `NULL` | `TRUE` | `NULL` | `FALSE`
22-
|`TRUE` | `TRUE` | `TRUE` | `TRUE` | `FALSE` | `FALSE`
23-
|`NULL` | `FALSE` | `FALSE` | `NULL` | `NULL` | `NULL`
24-
|`NULL` | `NULL` | `NULL` | `NULL` | `NULL` | `NULL`
25-
|`NULL` | `TRUE` | `NULL` | `TRUE` | `NULL` | `NULL`
17+
|`false` | `false` | `false` | `false` | `false` | `true`
18+
|`false` | `null` | `false` | `null` | `null` | `true`
19+
|`false` | `true` | `false` | `true` | `true` | `true`
20+
|`true` | `false` | `false` | `true` | `true` | `false`
21+
|`true` | `null` | `null` | `true` | `null` | `false`
22+
|`true` | `true` | `true` | `true` | `false` | `false`
23+
|`null` | `false` | `false` | `null` | `null` | `null`
24+
|`null` | `null` | `null` | `null` | `null` | `null`
25+
|`null` | `true` | `null` | `true` | `null` | `null`
2626
|===
2727

2828
[[example-graph]]

modules/ROOT/pages/expressions/predicates/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= Predicates
22
:Description: Overview of the predicate expressions in Cypher.
33

4-
Predicates evaluate to a `BOOLEAN` value (`TRUE`, `FALSE`, or `NULL`), and are frequently used for filtering in xref:clauses/where.adoc[`WHERE`] subclauses.
4+
Predicates evaluate to a `BOOLEAN` value (`true`, `false`, or `null`), and are frequently used for filtering in xref:clauses/where.adoc[`WHERE`] subclauses.
55

66
This chapter is divided into the following sections:
77

modules/ROOT/pages/expressions/predicates/list-operators.adoc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Only `Cecilia` is returned because she shares a `role` with `Cecil` (no `Person`
112112
=====
113113
114114
The presence of duplicate values in a `LIST` does not affect the result of the `IN` operator, which checks whether an element appears at least once.
115-
For example, the below query returns `TRUE` (two `Person` nodes are `39` years old).
115+
For example, the below query returns `true` (two `Person` nodes are `39` years old).
116116
117117
.Membership check in a `LIST` with duplicate values
118118
[source, cypher]
@@ -127,7 +127,7 @@ RETURN 39 IN allAges AS listWithDuplicates
127127
|===
128128
| listWithDuplicates
129129
130-
| TRUE
130+
| true
131131
132132
1+d|Rows: 1
133133
|===
@@ -136,33 +136,33 @@ RETURN 39 IN allAges AS listWithDuplicates
136136

137137

138138
[[null-behavior]]
139-
== `NULL` behavior
139+
== `null` behavior
140140

141-
When `NULL` is involved in a membership check, the result is will be `NULL`.
141+
When `null` is involved in a membership check, the result is will be `null`.
142142

143-
.Using the `IN` operator with `NULL`
143+
.Using the `IN` operator with `null`
144144
[source, cypher]
145145
----
146-
RETURN NULL IN [1, 2, NULL] AS nullInList, 123 IN NULL AS valueInNull
146+
RETURN null IN [1, 2, null] AS nullInList, 123 IN null AS valueInNull
147147
----
148148

149149
.Result
150150
[role="queryresult",options="header,footer",cols="2*<m"]
151151
|===
152152
| nullInList | valueInNull
153153

154-
| NULL | NULL
154+
| null | null
155155

156156
2+d|Rows: 1
157157
|===
158158

159-
To check if `NULL` is a member of a `LIST`, use the xref:functions/predicate.adoc#functions-any[`any()`] function:
159+
To check if `null` is a member of a `LIST`, use the xref:functions/predicate.adoc#functions-any[`any()`] function:
160160

161-
.Checking if `NULL` is a member of a `LIST`
161+
.Checking if `null` is a member of a `LIST`
162162
// tag::expressions_predicates_list_operators_check_null[]
163163
[source, cypher]
164164
----
165-
RETURN any(x IN [1, 2, NULL] WHERE x IS NULL) AS containsNull
165+
RETURN any(x IN [1, 2, null] WHERE x IS NULL) AS containsNull
166166
----
167167
// end::expressions_predicates_list_operators_check_null[]
168168

@@ -171,7 +171,7 @@ RETURN any(x IN [1, 2, NULL] WHERE x IS NULL) AS containsNull
171171
|===
172172
| containsNull
173173

174-
| TRUE
174+
| true
175175

176176
1+d|Rows: 1
177177
|===
@@ -180,7 +180,7 @@ RETURN any(x IN [1, 2, NULL] WHERE x IS NULL) AS containsNull
180180
== Nested lists
181181

182182
When used with nested `LIST` values, the `IN` operator evaluates whether a `LIST` is an exact match to any of the nested `LIST` values that are part of an outer `LIST`.
183-
Partial matches of individual elements within a nested `LIST` will return `FALSE`.
183+
Partial matches of individual elements within a nested `LIST` will return `false`.
184184

185185
.Checking for membership in nested `LIST` values
186186
[source, cypher]
@@ -193,7 +193,7 @@ RETURN [0, 2] IN [[1, 2], [3, 4]] AS listInNestedList
193193
|===
194194
| listInNestedList
195195

196-
| FALSE
196+
| false
197197

198198
1+d|Rows: 1
199199
|===
@@ -212,7 +212,7 @@ RETURN [3, 4] IN [[1, 2], [3, 4]] AS listInNestedList
212212
|===
213213
| listInNestedList
214214

215-
| TRUE
215+
| true
216216

217217
1+d|Rows: 1
218218
|===
@@ -229,7 +229,7 @@ RETURN [1] IN [[1, 2], [3, 4]] AS listInNestedTest
229229
|===
230230
| listInNestedList
231231

232-
| FALSE
232+
| false
233233

234234
1+d|Rows: 1
235235
|===
@@ -249,14 +249,14 @@ RETURN all(x IN sub WHERE x IN list) AS subInList
249249
----
250250
// end::expressions_predicates_list_operators_list_subset[]
251251

252-
This returns `TRUE` because all elements in `sub` are part of `list`.
252+
This returns `true` because all elements in `sub` are part of `list`.
253253

254254
.Result
255255
[role="queryresult",options="header,footer",cols="1*<m"]
256256
|===
257257
| subInList
258258

259-
| TRUE
259+
| true
260260

261261
1+d|Rows: 1
262262
|===
@@ -268,14 +268,14 @@ WITH [1,3,9] AS sub, [3,5,1,7,6,2,8,4] AS list
268268
RETURN all(x IN sub WHERE x IN list) AS subInList
269269
----
270270

271-
This returns `FALSE` because all elements in `sub` are not part of `list`.
271+
This returns `false` because all elements in `sub` are not part of `list`.
272272

273273
.Result
274274
[role="queryresult",options="header,footer",cols="1*<m"]
275275
|===
276276
| subInList
277277

278-
| FALSE
278+
| false
279279

280280
1+d|Rows: 1
281281
|===

0 commit comments

Comments
 (0)