diff --git a/antora.yml b/antora.yml index 47c896cc7..b8e8b46f9 100644 --- a/antora.yml +++ b/antora.yml @@ -7,5 +7,5 @@ nav: asciidoc: attributes: neo4j-version: '5' - neo4j-version-minor: '5.7' - neo4j-version-exact: '5.7.0' + neo4j-version-minor: '5.8' + neo4j-version-exact: '5.8.0' diff --git a/modules/ROOT/pages/administration/access-control/dbms-administration.adoc b/modules/ROOT/pages/administration/access-control/dbms-administration.adoc index 900c30032..af66a453b 100644 --- a/modules/ROOT/pages/administration/access-control/dbms-administration.adoc +++ b/modules/ROOT/pages/administration/access-control/dbms-administration.adoc @@ -1959,6 +1959,8 @@ a|Rows: 2 [[access-control-dbms-administration-setting]] == The DBMS `SETTING` privileges +_This feature was introduced in Neo4j 5.6._ + The ability to show configuration settings can be granted via the `SHOW SETTING` privilege. A role with this privilege is allowed to query the configuration settings matched by the xref::administration/access-control/dbms-administration.adoc#access-control-name-globbing[name-globbing]. diff --git a/modules/ROOT/pages/administration/databases.adoc b/modules/ROOT/pages/administration/databases.adoc index 35f0ea4aa..2b579c3ca 100644 --- a/modules/ROOT/pages/administration/databases.adoc +++ b/modules/ROOT/pages/administration/databases.adoc @@ -309,7 +309,7 @@ If a user has not been granted `ACCESS` privilege to any databases nor any of th ==== [NOTE] ==== -Databases hosted on servers that are offline are also returned by the `SHOW DATABASES` command. +As of Neo4j 5.3, databases hosted on servers that are offline are also returned by the `SHOW DATABASES` command. For such databases, the `address` column displays `NULL`, the `currentStatus` column displays `unknown`, and the `statusMessage` displays `Server is unavailable`. ==== @@ -1126,6 +1126,8 @@ To ensure the database to be dropped is standard and not composite, the user fir [[administration-wait-nowait]] == Wait options +_The_ `WAIT` _subclause was added as an option to the_ `ALTER DATABASE` _command in Neo4j 5.7._ + Aside from `SHOW DATABASES`, all database management commands accept an optional `WAIT`/`NOWAIT` clause. The `WAIT`/`NOWAIT` clause allows you to specify a time limit in which the command must complete and return. diff --git a/modules/ROOT/pages/administration/servers.adoc b/modules/ROOT/pages/administration/servers.adoc index 6b5f13d5b..8b7a3949d 100644 --- a/modules/ROOT/pages/administration/servers.adoc +++ b/modules/ROOT/pages/administration/servers.adoc @@ -322,6 +322,7 @@ This may not be specified in combination with `allowedDatabases`. | tags | list of server tags | List of server tags used during database allocation and for load balancing and routing policies. +label:new[Introduced in 5.6] |=== [NOTE] @@ -368,6 +369,7 @@ This may not be specified in combination with `allowedDatabases`. | tags | list of server tags | List of server tags used during database allocation and for load balancing and routing policies. +label:new[Introduced in 5.6] |=== [NOTE] @@ -392,9 +394,12 @@ The new name of the server must be unique. [[server-management-reallocate]] == Reallocate databases +_The_ `DRYRUN` _feature was introduced in Neo4j 5.2._ + After enabling a server, `REALLOCATE DATABASES` can be used to make the cluster re-balance databases across all servers that are part of the cluster. Using `DRYRUN REALLOCATE DATABASE` returns a view of how the databases would have been re-balanced if the command was executed without `DRYRUN`: + .Result [options="header,footer", width="100%", cols="m,m,m,m,m,m"] |=== @@ -404,10 +409,6 @@ Using `DRYRUN REALLOCATE DATABASE` returns a view of how the databases would hav | "db3" | "server-1" | "00000000-94ff-4ede-87be-3d741b795480" | "server-5" | "00000003-0df7-4057-81fd-1cf43c9ef5f7" | "primary" |=== -[NOTE] -==== -`DRYRUN` is introduced in Neo4j 5.2, and thus is not available in earlier minor releases of v5. -==== [role=not-on-aura] [[server-management-deallocate]] diff --git a/modules/ROOT/pages/clauses/call-subquery.adoc b/modules/ROOT/pages/clauses/call-subquery.adoc index 4dbbd751b..4b941a231 100644 --- a/modules/ROOT/pages/clauses/call-subquery.adoc +++ b/modules/ROOT/pages/clauses/call-subquery.adoc @@ -607,6 +607,9 @@ For larger data sets, you might want to use larger batch sizes, such as `10000 R ==== === Error behaviour [[txs_error_behaviour]] + +_This feature was introduced in Neo4j 5.7._ + Users can choose one of three different option flags to control the behaviour in case of an error occurring in any of the inner transactions of `+CALL { ... } IN TRANSACTIONS+`: diff --git a/modules/ROOT/pages/clauses/listing-settings.adoc b/modules/ROOT/pages/clauses/listing-settings.adoc index de8fb5ce2..0818c2bb2 100644 --- a/modules/ROOT/pages/clauses/listing-settings.adoc +++ b/modules/ROOT/pages/clauses/listing-settings.adoc @@ -3,10 +3,7 @@ [[query-listing-settings]] = SHOW SETTINGS -[abstract] --- -This section explains the `SHOW SETTINGS` command. --- +_This feature was introduced in Neo4j 5.6._ Listing the configuration settings on a server can be done with `SHOW SETTINGS`. diff --git a/modules/ROOT/pages/constraints/examples.adoc b/modules/ROOT/pages/constraints/examples.adoc index beaf0db61..5a4848e86 100644 --- a/modules/ROOT/pages/constraints/examples.adoc +++ b/modules/ROOT/pages/constraints/examples.adoc @@ -322,6 +322,8 @@ RETURN book1, book2 [[constraints-examples-relationship-uniqueness]] == Relationship property uniqueness constraints +_This feature was introduced in Neo4j 5.7._ + A relationship property uniqueness constraint ensures that all relationships with a particular relationship type have a set of defined properties whose combined value is unique when existing. * xref::constraints/examples.adoc#constraints-create-a-relationship-uniqueness-constraints[] @@ -1400,6 +1402,8 @@ RETURN actor, 'non-existing' AS reason [[constraints-examples-relationship-key]] == Relationship key constraints +_This feature was introduced in Neo4j 5.7._ + A relationship key constraint ensures that all relationships with a particular relationship type have a set of defined properties whose combined value is unique. It also ensures that all properties in the set are present. diff --git a/modules/ROOT/pages/constraints/index.adoc b/modules/ROOT/pages/constraints/index.adoc index ac1ab9687..03e8b3deb 100644 --- a/modules/ROOT/pages/constraints/index.adoc +++ b/modules/ROOT/pages/constraints/index.adoc @@ -19,6 +19,8 @@ For property uniqueness constraints on multiple properties, the combination of t Node property uniqueness constraints do not require all nodes to have a unique value for the properties listed (nodes without all properties are not subject to this rule). *Unique relationship property constraints*:: +_This feature was introduced in Neo4j 5.7._ ++ Unique relationship property constraints, or relationship property uniqueness constraints, ensure that property values are unique for all relationships with a specific type. For property uniqueness constraints on multiple properties, the combination of the property values is unique. Relationship property uniqueness constraints do not require all relationships to have a unique value for the properties listed (relationships without all properties are not subject to this rule). @@ -48,6 +50,8 @@ Queries attempting to do any of the following will fail: * Update the properties so that the combination of property values is no longer unique. *Relationship key constraints* label:enterprise-edition[]:: +_This feature was introduced in Neo4j 5.7._ ++ Relationship key constraints ensure that, for a given type and set of properties: + [lowerroman] diff --git a/modules/ROOT/pages/constraints/syntax.adoc b/modules/ROOT/pages/constraints/syntax.adoc index 75cf3d014..74a2db407 100644 --- a/modules/ROOT/pages/constraints/syntax.adoc +++ b/modules/ROOT/pages/constraints/syntax.adoc @@ -261,6 +261,7 @@ This is the default if none is given. |UNIQUE[NESS] | Returns all property uniqueness constraints, for both nodes and relationships. +_This feature was introduced in Neo4j 5.3._ |NODE [PROPERTY] EXIST[ENCE] | Returns the node property existence constraints. diff --git a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc index a9a76f5d8..4455b928d 100644 --- a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc +++ b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc @@ -10,6 +10,55 @@ New features are added to the language continuously, and occasionally, some feat This section lists all of the features that have been removed, deprecated, added, or extended in different Cypher versions. Replacement syntax for deprecated and removed features are also indicated. + +[[cypher-deprecations-additions-removals-5.8]] +== Version 5.8 + +=== New features + +[cols="2", options="header"] +|=== +| Feature +| Details + +a| +label:functionality[] +label:new[] + +New operator: `AssertSameRelationship` + +a| +The `AssertSameRelationship` operator is used to ensure that no relationship property uniqueness constraints are violated in the slotted and interpreted runtime. +More information can be found xref::execution-plans/operators.adoc#query-plan-assert-same-relationship[here]. + +|=== + + +=== Updated features + +[cols="2", options="header"] +|=== +| Feature +| Details + +a| +label:functionality[] +label:updated[] +[source, cypher, role="noheader"] +---- +SHOW INDEXES +---- +a| +Introduced `lastRead`, `readCount`, and `trackedSince` columns. +Both `lastRead` and `readCount` are returned by default. + +The `lastRead` column returns the last time the index was used for reading. +The `readCount` column returns the number of read queries that have been issued to this index. +The `trackedSince` column returns the time when usage statistics tracking started for this index. + +|=== + + [[cypher-deprecations-additions-removals-5.7]] == Version 5.7 @@ -23,7 +72,7 @@ Replacement syntax for deprecated and removed features are also indicated. a| label:functionality[] label:new[] -[source, syntax] +[source, syntax, role=noheader] ---- CALL { @@ -134,6 +183,7 @@ The existing `UNIQUENESS` filter will now return both node and relationship prop === New features + [cols="2", options="header"] |=== | Feature @@ -141,7 +191,23 @@ The existing `UNIQUENESS` filter will now return both node and relationship prop a| label:functionality[] -label:added[] +label:new[] + +`server.tag` + +a| New functionality to change tags at runtime via `ALTER SERVER`. +More information can be found xref::administration/servers.adoc#server-management-alter-server[here]. + +|=== + +[cols="2", options="header"] +|=== +| Feature +| Details + +a| +label:functionality[] +label:new[] [source, cypher, role="noheader"] ---- COLLECT { @@ -188,6 +254,25 @@ New privilege that controls a user's access to desired configuration settings. [[cypher-deprecations-additions-removals-5.5]] == Version 5.5 +=== New features + +[cols="2", options="header"] +|=== +| Feature +| Details + +a| +label:functionality[] +label:new[] + +New operator: `IntersectionNodeByLabelsScan` + +a| +The `IntersectionNodeByLabelsScan` operator fetches all nodes that have all of the provided labels from the node label index. +More information can be found xref::execution-plans/operators.adoc#query-plan-intersection-node-by-labels-scan[here]. + +|=== + === Deprecated features [cols="2", options="header"] diff --git a/modules/ROOT/pages/execution-plans/operator-summary.adoc b/modules/ROOT/pages/execution-plans/operator-summary.adoc index b7336675b..a76f74f4f 100644 --- a/modules/ROOT/pages/execution-plans/operator-summary.adoc +++ b/modules/ROOT/pages/execution-plans/operator-summary.adoc @@ -53,7 +53,13 @@ Tests for the absence of a pattern predicate. | | xref::execution-plans/operators.adoc#query-plan-assert-same-node[AssertSameNode] -| Used to ensure that no property uniqueness constraints are violated. +| Ensures that no node property uniqueness constraints are violated. +| +| +| + +| xref::execution-plans/operators.adoc#query-plan-assert-same-relationship[AssertSameRelationship] +| Ensures that no relationship property uniqueness constraints are violated. | | | diff --git a/modules/ROOT/pages/execution-plans/operators.adoc b/modules/ROOT/pages/execution-plans/operators.adoc index 5cd266dbd..da88a2513 100644 --- a/modules/ROOT/pages/execution-plans/operators.adoc +++ b/modules/ROOT/pages/execution-plans/operators.adoc @@ -49,21 +49,21 @@ CREATE (me:Person {name: 'me'}), (executive:Team {name: 'Team Executive'}), (remoting:Team {name: 'Team Remoting'}), (other:Team {name: 'Other'}), - (me)-[:WORKS_IN {duration: 190, title: 'senior sales engineer'}]->(london), - (bob)-[:WORKS_IN {duration: 187, title: 'junior developer'}]->(london), - (andy)-[:WORKS_IN {duration: 150, title: ''}]->(london), - (mattias)-[:WORKS_IN {duration: 230, title: 'senior developer'}]->(london), - (lovis)-[:WORKS_IN {duration: 230, title: 'junior developer'}]->(sf), - (pontus)-[:WORKS_IN {duration: 230, title: 'junior developer'}]->(malmo), - (max)-[:WORKS_IN {duration: 230, title: 'field engineer'}]->(newyork), - (konstantin)-[:WORKS_IN {duration: 230, title: 'frontend developer'}]->(london), - (stefan)-[:WORKS_IN {duration: 230, title: 'chief architect'}]->(london), - (stefan)-[:WORKS_IN {duration: 230, title: 'language architect'}]->(berlin), - (mats)-[:WORKS_IN {duration: 230, title: 'senior developer'}]->(malmo), - (petra)-[:WORKS_IN {duration: 230, title: 'language architect'}]->(london), - (craig)-[:WORKS_IN {duration: 230, title: 'senior developer'}]->(malmo), - (steven)-[:WORKS_IN {duration: 230, title: 'junior developer'}]->(malmo), - (chris)-[:WORKS_IN {duration: 230, title: 'field engineer'}]->(madrid), + (me)-[:WORKS_IN {id: 0, duration: 190, title: 'senior sales engineer', badgeNumber: 4332}]->(london), + (bob)-[:WORKS_IN {id: 1, duration: 187, title: 'junior developer', badgeNumber: 3293}]->(london), + (andy)-[:WORKS_IN {id: 2, duration: 150, title: ''}]->(london), + (mattias)-[:WORKS_IN {id: 3, duration: 230, title: 'senior developer', badgeNumber: 7627}]->(london), + (lovis)-[:WORKS_IN {id: 4, duration: 230, title: 'junior developer'}]->(sf), + (pontus)-[:WORKS_IN {id: 5, duration: 230, title: 'junior developer', badgeNumber: 9596}]->(malmo), + (max)-[:WORKS_IN {id: 6, duration: 230, title: 'field engineer', badgeNumber: 4416}]->(newyork), + (konstantin)-[:WORKS_IN {id: 7, duration: 230, title: 'frontend developer'}]->(london), + (stefan)-[:WORKS_IN {id: 8, duration: 230, title: 'chief architect', badgeNumber: 2951}]->(london), + (stefan)-[:WORKS_IN {id: 9, duration: 230, title: 'language architect', badgeNumber: 7092}]->(berlin), + (mats)-[:WORKS_IN {id: 10, duration: 230, title: 'senior developer', badgeNumber: 1402}]->(malmo), + (petra)-[:WORKS_IN {id: 11, duration: 230, title: 'language architect'}]->(london), + (craig)-[:WORKS_IN {id: 12, duration: 230, title: 'senior developer'}]->(malmo), + (steven)-[:WORKS_IN {id: 13, duration: 230, title: 'junior developer', badgeNumber: 1515}]->(malmo), + (chris)-[:WORKS_IN {id: 14, duration: 230, title: 'field engineer', badgeNumber: 6828}]->(madrid), (london)-[:IN]->(england), (me)-[:FRIENDS_WITH]->(andy), (andy)-[:FRIENDS_WITH]->(bob), @@ -77,6 +77,9 @@ CREATE (me:Person {name: 'me'}), (bob)-[:FRIENDS_WITH]->(andy), (steven)-[:FRIENDS_WITH]->(mats), (mattias)-[:FRIENDS_WITH]->(me); + +CREATE CONSTRAINT constraint_WORKS_IN_id_unique IF NOT EXISTS FOR ()-[r:WORKS_IN]-() REQUIRE (r.id) IS UNIQUE; +CREATE CONSTRAINT constraint_WORKS_IN_badgeNumber_unique IF NOT EXISTS FOR ()-[r:WORKS_IN]-() REQUIRE (r.badgeNumber) IS UNIQUE; ---- //// @@ -734,6 +737,8 @@ Total database accesses: 13, total allocated memory: 184 // IntersectionNodeByLabelsScan // New in 5.4 +_This feature was introduced in Neo4j 5.5._ + The `IntersectionNodeByLabelsScan` operator fetches all nodes that have all of the provided labels from the node label index. ====== @@ -2772,9 +2777,9 @@ Total database accesses: 1, total allocated memory: 200 == Assert Same Node // AssertSameNode -The `AssertSameNode` operator is used to ensure that no property uniqueness constraints are violated in the slotted and interpreted runtime. -The example looks for the presence of a team with the supplied name and id, and if one does not exist, it will be created. -Owing to the existence of two property uniqueness constraints on `:Team(name)` and `:Team(id)`, any node that would be found by the `UniqueIndexSeek` operator must be the very same node or the constraints would be violated. +The `AssertSameNode` operator is used to ensure that no node property uniqueness constraints are violated in the slotted and interpreted runtime. +The example looks for the presence of a team node with the supplied name and id, and if one does not exist, it will be created. +Owing to the existence of two node property uniqueness constraints on `:Team(name)` and `:Team(id)`, any node that would be found by the `UniqueIndexSeek` operator must be the very same node or the constraints would be violated. .AssertSameNode @@ -2819,6 +2824,60 @@ Total database accesses: 2, total allocated memory: 64 ====== +[[query-plan-assert-same-relationship]] +== Assert Same Relationship +// AssertSameRelationship + +_This feature was introduced in Neo4j 5.8._ + +The `AssertSameRelationship` operator is used to ensure that no relationship property uniqueness constraints are violated in the slotted and interpreted runtime. +The example looks for the presence of a `WORKS_IN` relationship with the supplied `id` and `badgeNumber`. +If it can't be found, then it will be created. +Owing to the existence of two property uniqueness constraints on `:WORKS_IN(id)` and `:WORKS_IN(badgeNumber)`, any relationship that would be found by the `DirectedRelationshipUniqueIndexSeek` operator must be the very same relationship or the constraints would be violated. + + +.AssertSameRelationship +====== + +.Query +[source, cypher] +---- +PROFILE +CYPHER runtime=slotted +MERGE (person)-[work:WORKS_IN {id: 0, badgeNumber: 4332}]->(location) +---- + +.Query Plan +[role="queryplan", subs="attributes+"] +---- +Planner COST + +Runtime SLOTTED + +Runtime version {neo4j-version-minor} + ++-------------------------------------------------+----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ +| Operator | Id | Details | Estimated Rows | Rows | DB Hits | Page Cache Hits/Misses | ++-------------------------------------------------+----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ +| +ProduceResults | 0 | | 1 | 0 | 0 | 0/0 | +| | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ +| +EmptyResult | 1 | | 1 | 0 | 0 | 0/0 | +| | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ +| +Merge | 2 | CREATE (person), (location), (person)-[work:WORKS_IN {id: $autoint_0, badgeNumber: $autoint_1}]->(lo | 1 | 1 | 0 | 0/0 | +| | | | cation) | | | | | +| | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ +| +AssertSameRelationship | 3 | work | 0 | 1 | 0 | 0/0 | +| |\ +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ +| | +DirectedRelationshipUniqueIndexSeek(Locking) | 4 | RANGE INDEX (person)-[work:WORKS_IN(badgeNumber)]->(location) WHERE badgeNumber = $autoint_1 | 1 | 1 | 1 | 0/1 | +| | +----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ +| +DirectedRelationshipUniqueIndexSeek(Locking) | 5 | RANGE INDEX (person)-[work:WORKS_IN(id)]->(location) WHERE id = $autoint_0 | 1 | 1 | 1 | 1/1 | ++-------------------------------------------------+----+------------------------------------------------------------------------------------------------------+----------------+------+---------+------------------------+ + +Total database accesses: 2, total allocated memory: 64 +---- + +====== + // DropResult -- removed in 4.3 diff --git a/modules/ROOT/pages/indexes-for-search-performance.adoc b/modules/ROOT/pages/indexes-for-search-performance.adoc index a3e1bbd01..28a5ca306 100644 --- a/modules/ROOT/pages/indexes-for-search-performance.adoc +++ b/modules/ROOT/pages/indexes-for-search-performance.adoc @@ -55,6 +55,7 @@ Using the keyword `IF NOT EXISTS` makes the command idempotent, and no error wil For a brief overview of the syntax, for all the index commands, see xref::indexes-for-search-performance.adoc#indexes-syntax[]. + [[indexes-create-indexes]] == +CREATE INDEX+ @@ -211,7 +212,8 @@ ON (r.propertyName) More details about the syntax descriptions can be found xref:administration/index.adoc#administration-syntax[here]. -Text indexes have two index providers available, `text-2.0` (default) and `text-1.0` (deprecated), and no supported index configuration. +As of Neo4j 5.1, text indexes have two index providers available, `text-2.0` (default) and `text-1.0` (deprecated), and no supported index configuration. + [NOTE] ==== @@ -662,6 +664,43 @@ 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 +======= +| `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[] +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[] +| `INTEGER` + +// New in 5.8 +| `trackedSince` +| The time when usage statistics tracking started for this index, or `null` if the statistics are not tracked. +| `DATETIME` + | `options` | The options passed to `CREATE` command. | `MAP` @@ -710,29 +749,30 @@ SHOW INDEXES // SHOW INDEXES default outputs // 4.4: id, name, state, populationPercent, uniqueness, type, entityType, labelsOrTypes, properties, indexProvider // 5.0: id, name, state, populationPercent, type, entityType, labelsOrTypes, properties, indexProvider, owningConstraint +// 5.8: id, name, state, populationPercent, type, entityType, labelsOrTypes, properties, indexProvider, owningConstraint, lastRead, readCount .Result [queryresult] ---- -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| id | name | state | populationPercent | type | entityType | labelsOrTypes | properties | indexProvider | owningConstraint | -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| 3 | "composite_range_node_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["age", "country"] | "range-1.0" | NULL | -| 4 | "composite_range_rel_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["PURCHASED"] | ["date", "amount"] | "range-1.0" | NULL | -| 13 | "example_index" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Book"] | ["title"] | "range-1.0" | NULL | -| 14 | "indexOnBooks" | "ONLINE" | 100.0 | "TEXT" | "NODE" | ["Label1"] | ["prop1"] | "text-2.0" | NULL | -| 11 | "node_label_lookup_index" | "ONLINE" | 100.0 | "LOOKUP" | "NODE" | NULL | NULL | "token-lookup-1.0" | NULL | -| 8 | "node_point_index_name" | "ONLINE" | 100.0 | "POINT" | "NODE" | ["Person"] | ["sublocation"] | "point-1.0" | NULL | -| 1 | "node_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["surname"] | "range-1.0" | NULL | -| 5 | "node_text_index_nickname" | "ONLINE" | 100.0 | "TEXT" | "NODE" | ["Person"] | ["nickname"] | "text-2.0" | NULL | -| 10 | "point_index_with_config" | "ONLINE" | 100.0 | "POINT" | "NODE" | ["Label"] | ["prop2"] | "point-1.0" | NULL | -| 9 | "rel_point_index_name" | "ONLINE" | 100.0 | "POINT" | "RELATIONSHIP" | ["STREET"] | ["intersection"] | "point-1.0" | NULL | -| 2 | "rel_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["KNOWS"] | ["since"] | "range-1.0" | NULL | -| 6 | "rel_text_index_name" | "ONLINE" | 100.0 | "TEXT" | "RELATIONSHIP" | ["KNOWS"] | ["interest"] | "text-2.0" | NULL | -| 12 | "rel_type_lookup_index" | "ONLINE" | 100.0 | "LOOKUP" | "RELATIONSHIP" | NULL | NULL | "token-lookup-1.0" | NULL | -| 7 | "text_index_with_indexprovider" | "ONLINE" | 100.0 | "TEXT" | "RELATIONSHIP" | ["TYPE"] | ["prop1"] | "text-2.0" | NULL | -| 15 | "uniqueBookIsbn" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Book"] | ["isbn"] | "range-1.0" | "uniqueBookIsbn" | -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| id | name | state | populationPercent | type | entityType | labelsOrTypes | properties | indexProvider | owningConstraint | lastRead | readCount | ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| 3 | "composite_range_node_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["age", "country"] | "range-1.0" | NULL | NULL | 0 | +| 4 | "composite_range_rel_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["PURCHASED"] | ["date", "amount"] | "range-1.0" | NULL | 2023-03-13T11:41:44.537Z | 1 | +| 13 | "example_index" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Book"] | ["title"] | "range-1.0" | NULL | 2023-04-10T15:41:44.537Z | 2 | +| 14 | "indexOnBooks" | "ONLINE" | 100.0 | "TEXT" | "NODE" | ["Label1"] | ["prop1"] | "text-2.0" | NULL | NULL | 0 | +| 11 | "node_label_lookup_index" | "ONLINE" | 100.0 | "LOOKUP" | "NODE" | NULL | NULL | "token-lookup-1.0" | NULL | 2023-04-13T08:11:15.537Z | 10 | +| 8 | "node_point_index_name" | "ONLINE" | 100.0 | "POINT" | "NODE" | ["Person"] | ["sublocation"] | "point-1.0" | NULL | 2023-04-05T16:21:44.692Z | 1 | +| 1 | "node_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["surname"] | "range-1.0" | NULL | 2022-12-30T02:01:44.537Z | 6 | +| 5 | "node_text_index_nickname" | "ONLINE" | 100.0 | "TEXT" | "NODE" | ["Person"] | ["nickname"] | "text-2.0" | NULL | 2023-04-13T11:41:44.537Z | 2 | +| 10 | "point_index_with_config" | "ONLINE" | 100.0 | "POINT" | "NODE" | ["Label"] | ["prop2"] | "point-1.0" | NULL | NULL | 0 | +| 9 | "rel_point_index_name" | "ONLINE" | 100.0 | "POINT" | "RELATIONSHIP" | ["STREET"] | ["intersection"] | "point-1.0" | NULL | 2023-03-03T13:37:42.537Z | 2 | +| 2 | "rel_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["KNOWS"] | ["since"] | "range-1.0" | NULL | 2023-04-12T10:41:44.692Z | 5 | +| 6 | "rel_text_index_name" | "ONLINE" | 100.0 | "TEXT" | "RELATIONSHIP" | ["KNOWS"] | ["interest"] | "text-2.0" | NULL | 2023-04-01T10:40:44.537Z | 3 | +| 12 | "rel_type_lookup_index" | "ONLINE" | 100.0 | "LOOKUP" | "RELATIONSHIP" | NULL | NULL | "token-lookup-1.0" | NULL | 2023-04-12T21:41:44.537Z | 7 | +| 7 | "text_index_with_indexprovider" | "ONLINE" | 100.0 | "TEXT" | "RELATIONSHIP" | ["TYPE"] | ["prop1"] | "text-2.0" | NULL | NULL | 0 | +| 15 | "uniqueBookIsbn" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Book"] | ["isbn"] | "range-1.0" | "uniqueBookIsbn" | 2023-04-13T11:41:44.692Z | 6 | ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 15 rows ---- @@ -762,15 +802,15 @@ SHOW RANGE INDEXES WHERE owningConstraint IS NULL .Result [queryresult] ---- -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| id | name | state | populationPercent | type | entityType | labelsOrTypes | properties | indexProvider | owningConstraint | -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| 3 | "composite_range_node_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["age", "country"] | "range-1.0" | NULL | -| 4 | "composite_range_rel_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["PURCHASED"] | ["date", "amount"] | "range-1.0" | NULL | -| 13 | "example_index" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Book"] | ["title"] | "range-1.0" | NULL | -| 1 | "node_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["surname"] | "range-1.0" | NULL | -| 2 | "rel_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["KNOWS"] | ["since"] | "range-1.0" | NULL | -+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| id | name | state | populationPercent | type | entityType | labelsOrTypes | properties | indexProvider | owningConstraint | lastRead | readCount | ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| 3 | "composite_range_node_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["age", "country"] | "range-1.0" | NULL | NULL | 0 | +| 4 | "composite_range_rel_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["PURCHASED"] | ["date", "amount"] | "range-1.0" | NULL | 2023-03-13T11:41:44.537Z | 1 | +| 13 | "example_index" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Book"] | ["title"] | "range-1.0" | NULL | 2023-04-10T15:41:44.537Z | 2 | +| 1 | "node_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "NODE" | ["Person"] | ["surname"] | "range-1.0" | NULL | 2022-12-30T02:01:44.537Z | 6 | +| 2 | "rel_range_index_name" | "ONLINE" | 100.0 | "RANGE" | "RELATIONSHIP" | ["KNOWS"] | ["since"] | "range-1.0" | NULL | 2023-04-12T10:41:44.692Z | 5 | ++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 5 rows ---- diff --git a/modules/ROOT/pages/syntax/expressions.adoc b/modules/ROOT/pages/syntax/expressions.adoc index f86089eeb..efdc5f55a 100644 --- a/modules/ROOT/pages/syntax/expressions.adoc +++ b/modules/ROOT/pages/syntax/expressions.adoc @@ -518,6 +518,8 @@ RETURN person.name AS name, EXISTS { [[existential-subquery-with-union]] ==== `EXISTS` subquery with a `UNION` +_This feature was introduced in Neo4j 5.3._ + `Exists` can be used with a `UNION` clause, and the `RETURN` clauses are not required. It is worth noting that if one branch has a `RETURN` clause, then all branches require one. The below example demonstrates that if one of the `UNION` branches was to return at least one row, the entire `EXISTS` expression will evaluate to true. @@ -549,6 +551,8 @@ RETURN [[existential-subquery-with-with]] ==== `EXISTS` subquery with `WITH` +_This feature was introduced in Neo4j 5.3._ + Variables from the outside scope are visible for the entire subquery, even when using a `WITH` clause. This means that shadowing of these variables is not allowed. An outside scope variable is shadowed when a newly introduced variable within the inner scope is defined with the same variable. @@ -579,6 +583,8 @@ RETURN person.name AS name [[existential-subquery-with-return]] ==== `EXISTS` subquery with `RETURN` +_This feature was introduced in Neo4j 5.3._ + `EXISTS` subqueries do not require a `RETURN` clause at the end of the subquery. If one is present, it does not need to be aliased, which is different compared to xref::clauses/call-subquery.adoc[`CALL` subqueries]. Any variables returned in an `EXISTS` subquery will not be available after the subquery. @@ -669,6 +675,8 @@ RETURN person.name AS name [[count-subquery-with-union]] ==== `COUNT` subquery with a `UNION` +_This feature was introduced in Neo4j 5.3._ + `COUNT` can be used with a `UNION` clause. If the `UNION` clause is distinct, the `RETURN` clause is required. `UNION ALL` clauses do not require the `RETURN` clause. However, it is worth noting that if one branch has a `RETURN` clause, then all require one. The below example shows the count of pets each person has by using a `UNION` clause: @@ -702,6 +710,8 @@ RETURN [[count-subquery-with-with]] ==== `COUNT` subquery with `WITH` +_This feature was introduced in Neo4j 5.3._ + Variables from the outside scope are visible for the entire subquery, even when using a `WITH` clause. This means that shadowing of these variables is not allowed. An outside scope variable is shadowed when a newly introduced variable within the inner scope is defined with the same variable. @@ -839,6 +849,8 @@ RETURN COUNT { (person)-[:HAS_DOG]->(:Dog) } AS numDogs, [[count-subquery-with-return]] ==== `COUNT` subquery with `RETURN` +_This feature was introduced in Neo4j 5.3._ + `COUNT` subqueries do not require a `RETURN` clause at the end of the subquery. If one is present, it does not need to be aliased. This is a difference compared to from xref::clauses/call-subquery.adoc[`CALL` subqueries]. Any variables returned in a `COUNT` subquery will not be available after the subquery. @@ -866,6 +878,8 @@ RETURN person.name AS name [[collect-subqueries]] === `COLLECT` subqueries +_This feature was introduced in Neo4j 5.6._ + A `COLLECT` subquery expression can be used to create a list with the rows returned by a given subquery. Any non-writing query is allowed.