diff --git a/README.adoc b/README.adoc index 034551292..ed671a939 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,6 @@ = Neo4j Cypher Manual -== Build +== Building locally === Prereqs @@ -27,14 +27,14 @@ npm run build To view the built site, launch a local server: -1. `npm start` -2. In a browser tab, go to `localhost:8000` +. `npm start` +. In a browser tab, go to `localhost:8000` === Live preview When you run `npm start`, the project is monitored for updates to asciidoc files. -If a change to an asciidoc file is detected the site is automatically rebuilt. +If a change to an asciidoc file is detected, the site is automatically rebuilt. === Errors diff --git a/modules/ROOT/pages/administration/access-control/built-in-roles.adoc b/modules/ROOT/pages/administration/access-control/built-in-roles.adoc index cd29e7da2..24ebdaf37 100644 --- a/modules/ROOT/pages/administration/access-control/built-in-roles.adoc +++ b/modules/ROOT/pages/administration/access-control/built-in-roles.adoc @@ -453,8 +453,7 @@ To restore the role to its original capabilities two steps are needed. First, execute `DROP ROLE admin`. Secondly, run these queries: -// we cannot test this right now cause we would delete the role the test user is logged with - +// cannot test as it would require deleting the role the test user is logged with [source, cypher, role=noplay test-skip] ---- CREATE ROLE admin diff --git a/modules/ROOT/pages/administration/access-control/manage-users.adoc b/modules/ROOT/pages/administration/access-control/manage-users.adoc index 3e1d7bba8..b1d25ee05 100644 --- a/modules/ROOT/pages/administration/access-control/manage-users.adoc +++ b/modules/ROOT/pages/administration/access-control/manage-users.adoc @@ -817,6 +817,7 @@ Users can change their password using `ALTER CURRENT USER SET PASSWORD`. The old password is required in addition to the new one, and either or both can be a string value or a string parameter. When a user executes this command it will change their password as well as set the `CHANGE NOT REQUIRED` flag. +// can't test, don't want to hardcode test user password [source, cypher, role=test-skip] ---- ALTER CURRENT USER diff --git a/modules/ROOT/pages/administration/aliases.adoc b/modules/ROOT/pages/administration/aliases.adoc index fa5a52dd9..cd4208c6c 100644 --- a/modules/ROOT/pages/administration/aliases.adoc +++ b/modules/ROOT/pages/administration/aliases.adoc @@ -575,6 +575,7 @@ SHOW ALIAS `northwind` FOR DATABASE ====== Local database aliases can also be given properties. +These properties can then be used in queries with the xref::functions/graph.adoc#functions-graph-propertiesByName[`graph.propertiesByName()` function]. .Query [source, cypher] @@ -761,6 +762,7 @@ SHOW ALIAS `remote-with-driver-settings` FOR DATABASE YIELD * .+Setting properties for remote database aliases+ ====== Just as the local database aliases, the remote database aliases can be given properties. +These properties can then be used in queries with the xref::functions/graph.adoc#functions-graph-propertiesByName[`graph.propertiesByName()` function]. .Query [source, cypher] @@ -1083,6 +1085,8 @@ ALTER ALIAS `movie scripts` SET DATABASE PROPERTIES { nameContainsSpace: true } System updates: 1 Rows: 0 ---- + +The updated properties can then be used in queries with the xref::functions/graph.adoc#functions-graph-propertiesByName[`graph.propertiesByName()` function]. ====== .+Altering local and remote aliases in composite databases+ @@ -1113,6 +1117,8 @@ System updates: 1 Rows: 0 ---- +The updated properties can then be used in queries with the xref::functions/graph.adoc#functions-graph-propertiesByName[`graph.propertiesByName()` function]. + ====== The changes for all database aliases will show up in the `SHOW ALIASES FOR DATABASE` command. diff --git a/modules/ROOT/pages/administration/databases.adoc b/modules/ROOT/pages/administration/databases.adoc index 2b579c3ca..e54dc1135 100644 --- a/modules/ROOT/pages/administration/databases.adoc +++ b/modules/ROOT/pages/administration/databases.adoc @@ -611,15 +611,6 @@ CREATE COMPOSITE DATABASE inventory [role="statsonlyqueryresult"] 0 rows, System updates: 1 -[NOTE] -==== -Composite database names are subject to the same rules as standard databases. -One difference is however that the deprecated syntax using dots without enclosing the name in backticks is not available. -Both dots and dashes needs to be enclosed within backticks when using composite databases. - - -==== - When a composite database has been created, it will show up in the listing provided by the command `SHOW DATABASES`. diff --git a/modules/ROOT/pages/clauses/listing-settings.adoc b/modules/ROOT/pages/clauses/listing-settings.adoc index 0818c2bb2..c2d4557d5 100644 --- a/modules/ROOT/pages/clauses/listing-settings.adoc +++ b/modules/ROOT/pages/clauses/listing-settings.adoc @@ -24,36 +24,44 @@ The `SHOW SETTINGS` command will produce a table with the following columns: .Show settings output -[options="header", cols="4,6"] +[options="header", cols="4,6,2"] |=== -| Column | Description +| Column | Description | Type m| name a| The name of the setting. label:default-output[] +m| STRING m| value a| The current value of the setting. label:default-output[] +m| STRING m| isDynamic a| Whether the value of the setting can be updated dynamically, without restarting the server. For dynamically updating a setting value, see link:{neo4j-docs-base-uri}/operations-manual/{page-version}/configuration/dynamic-settings/[Update dynamic settings]. label:default-output[] +m| BOOLEAN m| defaultValue a| The default value of the setting. label:default-output[] +m| STRING m| description a| The setting description. label:default-output[] +m| STRING m| startupValue a| The value of the setting at last startup. +m| STRING m| isExplicitlySet a| Whether the value of the setting is explicitly set by the user, either through configuration or dynamically. +m| BOOLEAN m| validValues a| A description of valid values for the setting. +m| STRING |=== diff --git a/modules/ROOT/pages/clauses/match.adoc b/modules/ROOT/pages/clauses/match.adoc index b0de00f2b..b27db7bb1 100644 --- a/modules/ROOT/pages/clauses/match.adoc +++ b/modules/ROOT/pages/clauses/match.adoc @@ -510,7 +510,7 @@ The following query adds two new paths between `Charlie Sheen` and his father `M The query makes evident that both actors had a leading role in the movie `No Code of Conduct`, but only `Martin Sheen` had a leading role in the movie `Free Money`. .Query -[source, cypher, indent=0] +[source, cypher] ---- MATCH (charlie:Person {name: 'Charlie Sheen'}), diff --git a/modules/ROOT/pages/clauses/merge.adoc b/modules/ROOT/pages/clauses/merge.adoc index 4cd4c6066..7d3ae8005 100644 --- a/modules/ROOT/pages/clauses/merge.adoc +++ b/modules/ROOT/pages/clauses/merge.adoc @@ -7,7 +7,7 @@ == Introduction The `MERGE` clause either matches existing node patterns in the graph and binds them or, if not present, creates new data and binds that. -In this way, it acts as a combination of `MATCH` and `CREATE` that allows for specific actions depending on whether the specified data was matched or created. +In this way, it acts as a combination of `MATCH` and `CREATE` that allows for specific actions depending on whether the specified data was matched or created. For example, `MERGE` can be used to specify that a graph must contain a node with a `Person` label and a specific `name` property. If there isn't a node with the specific `name` property, a new node will be created with that `name` property. @@ -80,7 +80,7 @@ RETURN robert, labels(robert) A new node is created because there are no nodes labeled `Critic` in the database: .Result -[role="queryresult",options="header,footer",cols="2*(daniel), (charlie)-[:KNOWS]->(daniel), (bob)-[:MARRIED]->(eskil) -//// - +---- [[functions-keys]] == keys() @@ -75,7 +77,7 @@ keys(expression) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a) WHERE a.name = 'Alice' RETURN keys(a) @@ -88,7 +90,7 @@ A list containing the names of all the properties on the node bound to `a` is re |=== | +keys(a)+ -| +["name","age","eyes"]+ +| +["eyes","name","age"]+ 1+d|Rows: 1 |=== @@ -140,7 +142,7 @@ labels(node) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a) WHERE a.name = 'Alice' RETURN labels(a) @@ -205,7 +207,7 @@ nodes(path) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND c.name = 'Eskil' @@ -273,7 +275,7 @@ range(start, end [, step]) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- RETURN range(0, 10), range(2, 18, 3), range(0, 5, -1) ---- @@ -343,7 +345,7 @@ reduce(accumulator = initial, variable IN list | expression) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND b.name = 'Bob' AND c.name = 'Daniel' @@ -409,7 +411,7 @@ relationships(path) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND c.name = 'Eskil' @@ -474,7 +476,7 @@ reverse(original) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- WITH [4923,'abc',521, null, 487] AS ids RETURN reverse(ids) @@ -528,7 +530,7 @@ tail(list) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a) WHERE a.name = 'Eskil' RETURN a.array, tail(a.array) @@ -665,7 +667,7 @@ toFloatList(list) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- RETURN toFloatList(null) as noList, toFloatList([null, null]) as nullsInList, @@ -733,7 +735,7 @@ toIntegerList(list) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- RETURN toIntegerList(null) as noList, toIntegerList([null, null]) as nullsInList, @@ -802,7 +804,7 @@ toStringList(list) ====== .Query -[source, cypher, indent=0] +[source, cypher] ---- RETURN toStringList(null) as noList, toStringList([null, null]) as nullsInList, diff --git a/modules/ROOT/pages/functions/temporal/index.adoc b/modules/ROOT/pages/functions/temporal/index.adoc index 9fe09b7d0..19db53173 100644 --- a/modules/ROOT/pages/functions/temporal/index.adoc +++ b/modules/ROOT/pages/functions/temporal/index.adoc @@ -4254,7 +4254,7 @@ The current time of day using the local time zone is returned. ====== .Query -[source, cypher, role="test-result-skip"] +[source, cypher] ---- RETURN time({timezone: 'America/Los Angeles'}) AS currentTimeInLA ---- diff --git a/modules/ROOT/pages/indexes-for-search-performance.adoc b/modules/ROOT/pages/indexes-for-search-performance.adoc index 28a5ca306..f7565cf33 100644 --- a/modules/ROOT/pages/indexes-for-search-performance.adoc +++ b/modules/ROOT/pages/indexes-for-search-performance.adoc @@ -664,9 +664,7 @@ This command will produce a table with the following columns: | The name of the constraint the index is associated with or `null` if the index is not associated with any constraint. label:default-output[] | `STRING` -<<<<<<< HEAD -<<<<<<< HEAD -======= +// New in 5.8 | `lastRead` | The last time the index was used for reading. Returns `null` if the index has not been read since `trackedSince`, or if the statistics are not tracked. @@ -674,31 +672,16 @@ label:default-output[] label:new[Introduced in 5.8] | `DATETIME` -| `readCount` -| The number of read queries that have been issued to this index since `trackedSince`, or `null` if the statistics are not tracked. label:default-output[] -label:new[Introduced in 5.8] -| `INTEGER` - -| `trackedSince` -| The time when usage statistics tracking started for this index, or `null` if the statistics are not tracked. -label:new[Introduced in 5.8] -| `DATETIME` - - -// New in 5.8 -| `lastRead` -| The last time the index was used for reading. -Returns `null` if the index has not been read since `trackedSince`, or if the statistics are not tracked. label:default-output[] -| `DATETIME` - // New in 5.8 | `readCount` | The number of read queries that have been issued to this index since `trackedSince`, or `null` if the statistics are not tracked. label:default-output[] +label:new[Introduced in 5.8] | `INTEGER` // New in 5.8 | `trackedSince` | The time when usage statistics tracking started for this index, or `null` if the statistics are not tracked. +label:new[Introduced in 5.8] | `DATETIME` | `options` diff --git a/modules/ROOT/pages/introduction/cypher_overview.adoc b/modules/ROOT/pages/introduction/cypher_overview.adoc index f5a94daee..67c746f92 100644 --- a/modules/ROOT/pages/introduction/cypher_overview.adoc +++ b/modules/ROOT/pages/introduction/cypher_overview.adoc @@ -4,19 +4,28 @@ This section provides an overview of Cypher and a brief discussion of how Cypher differs to SQL. +//// +[source, cypher, role=test-setup] +---- +MERGE (matrix:Movie {title: 'The Matrix', rating: 10}) +MERGE (keanu:Person {name: 'Keanu Reeves'}) +MERGE (keanu)-[:ACTED_IN]->(matrix) +---- +//// + == What is Cypher? -Cypher is Neo4j’s declarative graph query language. -It was created in 2011 by Neo4j engineers as an SQL-equivalent language for graph databases. +Cypher is Neo4j's declarative graph query language. +It was created in 2011 by Neo4j engineers as an SQL-equivalent language for graph databases. Similar to SQL, Cypher lets users focus on _what_ to retrieve from graph, rather than _how_ to retrieve it. As such, Cypher enables users to realize the full potential of their property graph databases by allowing for efficient and expressive queries that reveal previously unknown data connections and clusters. -Cypher provides a visual way of matching patterns and relationships. +Cypher provides a visual way of matching patterns and relationships. It relies on the following ascii-art type of syntax: `(nodes)-[:CONNECT_TO]->(otherNodes)`. -Rounded brackets are used for circular nodes, and `-[:ARROWS]->` for relationships. -Writing a query is effectively like drawing a pattern through the data in the graph. +Rounded brackets are used for circular nodes, and `-[:ARROWS]->` for relationships. +Writing a query is effectively like drawing a pattern through the data in the graph. In other words, entities such as nodes and their relationships are visually built into queries. -This makes Cypher a highly intuitive language to both read and write. +This makes Cypher a highly intuitive language to both read and write. == Cypher and SQL: key differences @@ -41,11 +50,11 @@ FROM movie WHERE movie.rating > 7 ---- + -[source, cypher, role=test-skip] +[source, cypher] ---- MATCH (movie:Movie) WHERE movie.rating > 7 -RETURN movie.name +RETURN movie.title ---- *Cypher queries are more concise*:: @@ -62,7 +71,7 @@ FROM actors WHERE movies.title = "The Matrix" ---- + -[source, cypher, role=test-skip] +[source, cypher] ---- MATCH (actor:Actor)-[:ACTED_IN]->(movie:Movie {title: 'The Matrix'}) RETURN actor.name diff --git a/modules/ROOT/pages/styleguide.adoc b/modules/ROOT/pages/styleguide.adoc index 510af1e29..b99be669d 100644 --- a/modules/ROOT/pages/styleguide.adoc +++ b/modules/ROOT/pages/styleguide.adoc @@ -39,13 +39,13 @@ Arguments should normally not be included. * Start a new clause on a new line. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (n) WHERE n.name CONTAINS 's' RETURN n.name ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (n) WHERE n.name CONTAINS 's' @@ -56,7 +56,7 @@ RETURN n.name Put `ON CREATE` before `ON MATCH` if both are present. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MERGE (n) ON CREATE SET n.prop = 0 MERGE (a:A)-[:T]->(b:B) @@ -66,7 +66,7 @@ RETURN a.prop ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MERGE (n) ON CREATE SET n.prop = 0 @@ -80,7 +80,7 @@ RETURN a.prop Leave the closing brace on its own line. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a:A) WHERE @@ -89,7 +89,7 @@ RETURN a.foo ---- + .Also bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a:A) WHERE EXISTS @@ -99,7 +99,7 @@ RETURN a.foo ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a:A) WHERE EXISTS { @@ -112,7 +112,7 @@ RETURN a.foo * Do not break the line if the simplified subquery form is used. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a:A) WHERE EXISTS { @@ -122,7 +122,7 @@ RETURN a.prop ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a:A) WHERE EXISTS { (a)-->(b:B) } @@ -136,7 +136,7 @@ RETURN a.prop * Write keywords in upper case. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- match (p:Person) where p.name starts with 'Ma' @@ -144,7 +144,7 @@ return p.name ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (p:Person) WHERE p.name STARTS WITH 'Ma' @@ -154,14 +154,14 @@ RETURN p.name * Write the value `null` in lower case. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- WITH NULL AS n1, Null AS n2 RETURN n1 IS NULL AND n2 IS NOT NULL ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- WITH null AS n1, null AS n2 RETURN n1 IS NULL AND n2 IS NOT NULL @@ -170,14 +170,14 @@ RETURN n1 IS NULL AND n2 IS NOT NULL * Write boolean literals (`true` and `false`) in lower case. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- WITH TRUE AS b1, False AS b2 RETURN b1 AND b2 ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- WITH true AS b1, false AS b2 RETURN b1 AND b2 @@ -218,14 +218,14 @@ RETURN rand, map.propertyKey, count(n) ** No space between the last value and the closing brace + .Bad -[source, cypher, indent=0] +[source, cypher] ---- WITH { key1 :'value' ,key2 : 42 } AS map RETURN map ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- WITH {key1: 'value', key2: 42} AS map RETURN map @@ -234,14 +234,14 @@ RETURN map * One space between label/type predicates and property predicates in patterns. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (p:Person{property: -1})-[:KNOWS {since: 2016}]->() RETURN p.name ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (p:Person {property: -1})-[:KNOWS {since: 2016}]->() RETURN p.name @@ -250,14 +250,14 @@ RETURN p.name * No space in patterns. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person) --> (:Vehicle) RETURN count(*) ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person)-->(:Vehicle) RETURN count(*) @@ -266,7 +266,7 @@ RETURN count(*) * Use a wrapping space around operators. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH p=(s)-->(e) WHERE s.name<>e.name @@ -274,7 +274,7 @@ RETURN length(p) ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH p = (s)-->(e) WHERE s.name <> e.name @@ -284,14 +284,14 @@ RETURN length(p) * No space in label predicates. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (person : Person : Owner ) RETURN person.name ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (person:Person:Owner) RETURN person.name @@ -300,7 +300,7 @@ RETURN person.name * Use a space after each comma in lists and enumerations. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (),() WITH ['a','b',3.14] AS list @@ -308,7 +308,7 @@ RETURN list,2,3,4 ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (), () WITH ['a', 'b', 3.14] AS list @@ -318,13 +318,13 @@ RETURN list, 2, 3, 4 * No padding space within function call parentheses. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- RETURN split( 'original', 'i' ) ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- RETURN split('original', 'i') ---- @@ -332,7 +332,7 @@ RETURN split('original', 'i') * Use padding space within simple subquery expressions. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a:A) WHERE EXISTS {(a)-->(b:B)} @@ -340,7 +340,7 @@ RETURN a.prop ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (a:A) WHERE EXISTS { (a)-->(b:B) } @@ -354,7 +354,7 @@ RETURN a.prop * When patterns wrap lines, break after arrows, not before. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person)-->(vehicle:Car)-->(:Company) <--(:Country) @@ -362,7 +362,7 @@ RETURN count(vehicle) ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person)-->(vehicle:Car)-->(:Company)<-- (:Country) @@ -372,7 +372,7 @@ RETURN count(vehicle) * Use anonymous nodes and relationships when the variable would not be used. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- CREATE (a:End {prop: 42}), (b:End {prop: 3}), @@ -380,7 +380,7 @@ CREATE (a:End {prop: 42}), ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- CREATE (a:End {prop: 42}), (:End {prop: 3}), @@ -390,14 +390,14 @@ CREATE (a:End {prop: 42}), * Chain patterns together to avoid repeating variables. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person)-->(vehicle:Car), (vehicle:Car)-->(:Company) RETURN count(vehicle) ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person)-->(vehicle:Car)-->(:Company) RETURN count(vehicle) @@ -406,7 +406,7 @@ RETURN count(vehicle) * Put named nodes before anonymous nodes. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH ()-->(vehicle:Car)-->(manufacturer:Company) WHERE manufacturer.foundedYear < 2000 @@ -414,7 +414,7 @@ RETURN vehicle.mileage ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (manufacturer:Company)<--(vehicle:Car)<--() WHERE manufacturer.foundedYear < 2000 @@ -424,7 +424,7 @@ RETURN vehicle.mileage * Keep anchor nodes at the beginning of the `MATCH` clause. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person)-->(vehicle:Car)-->(manufacturer:Company) WHERE manufacturer.foundedYear < 2000 @@ -432,7 +432,7 @@ RETURN vehicle.mileage ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (manufacturer:Company)<--(vehicle:Car)<--(:Person) WHERE manufacturer.foundedYear < 2000 @@ -442,14 +442,14 @@ RETURN vehicle.mileage * Prefer outgoing (left to right) pattern relationships to incoming pattern relationships. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Country)-->(:Company)<--(vehicle:Car)<--(:Person) RETURN vehicle.mileage ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (:Person)-->(vehicle:Car)-->(:Company)<--(:Country) RETURN vehicle.mileage @@ -462,13 +462,13 @@ RETURN vehicle.mileage * Use single quotes, `'`, for literal string values. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- RETURN "Cypher" ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- RETURN 'Cypher' ---- @@ -478,13 +478,13 @@ If the string has both, use the form that creates the fewest escapes. In the case of a tie, prefer single quotes. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- RETURN 'Cypher\'s a nice language', "Mats' quote: \"statement\"" ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- RETURN "Cypher's a nice language", 'Mats\' quote: "statement"' ---- @@ -492,14 +492,14 @@ RETURN "Cypher's a nice language", 'Mats\' quote: "statement"' * Avoid having to use back-ticks to escape characters and keywords. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- MATCH (`odd-ch@racter$`:`Spaced Label` {`&property`: 42}) RETURN labels(`odd-ch@racter$`) ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- MATCH (node:NonSpacedLabel {property: 42}) RETURN labels(node) @@ -508,13 +508,13 @@ RETURN labels(node) * Do not use a semicolon at the end of the statement. + .Bad -[source, cypher, indent=0] +[source, cypher] ---- RETURN 1; ---- + .Good -[source, cypher, indent=0] +[source, cypher] ---- RETURN 1 ----