Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions modules/ROOT/images/call_subquery_graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions modules/ROOT/pages/clauses/create.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ This is because a relationship can only have exactly one type.
----

.Create nodes and relationships using dynamic node labels and relationship types
// tag::clauses_create_dynamic_create[]
[source, cypher]
----
CREATE (greta:$($nodeLabels) {name: 'Greta Gerwig'})
Expand All @@ -242,6 +243,7 @@ UNWIND $movies AS movieTitle
CREATE (greta)-[rel:$($relType)]->(m:Movie {title: movieTitle})
RETURN greta.name AS name, labels(greta) AS labels, type(rel) AS relType, collect(m.title) AS movies
----
// end::clauses_create_dynamic_create[]

.Result
[role="queryresult",options="footer",cols="4*<m"]
Expand Down
6 changes: 4 additions & 2 deletions modules/ROOT/pages/clauses/load-csv.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ It also mitigates the risk of Cypher injection.
(For more information about Cypher injection, see link:https://neo4j.com/developer/kb/protecting-against-cypher-injection/[Neo4j Knowledge Base -> Protecting against Cypher injection]).

.bands-with-headers.csv
[source, csv, filename="artists-with-headers.csv"]
[source, csv, filename="bands-with-headers.csv"]
----
Id,Label,Name
1,Band,The Beatles
Expand All @@ -318,12 +318,14 @@ Id,Label,Name
----

.Query
[source, cypher, role=test-skip]
// tag::clauses_load_csv_dynamic_columns[]
[source, cypher]
----
LOAD CSV WITH HEADERS FROM 'file:///bands-with-headers.csv' AS line
MERGE (n:$(line.Label) {name: line.Name})
RETURN n AS bandNodes
----
// end::clauses_load_csv_dynamic_columns[]

.Result
[role="queryresult",options="header,footer",cols="1*<m"]
Expand Down
8 changes: 7 additions & 1 deletion modules/ROOT/pages/clauses/match.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ RETURN directors
1+d|Rows: 2
|===

.Match nodes dynamically using the `any()` function
.Match nodes dynamically using `any()`
[source, cypher]
----
MATCH (n:$any(["Movie", "Actor"]))
Expand Down Expand Up @@ -576,11 +576,14 @@ RETURN n AS nodes
----

.Match nodes dynamically using a parameter
// tag::clauses_match_dynamic_match_parameter[]
[source, cypher]
----
MATCH (movie:$($label))
RETURN movie.title AS movieTitle
----
// end::clauses_match_dynamic_match_parameter[]


.Result
[role="queryresult",options="header,footer",cols="1*<m"]
Expand All @@ -595,13 +598,16 @@ RETURN movie.title AS movieTitle


.Match relationships dynamically using a variable
// tag::clauses_match_dynamic_match_variable[]
[source, cypher]
----
CALL db.relationshipTypes()
YIELD relationshipType
MATCH ()-[r:$(relationshipType)]->()
RETURN relationshipType, count(r) AS relationshipCount
----
// end::clauses_match_dynamic_match_variable[]


.Result
[role="queryresult",options="header,footer",cols="2*<m"]
Expand Down
2 changes: 2 additions & 0 deletions modules/ROOT/pages/clauses/merge.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ This is because the xref:planning-and-tuning/execution-plans.adoc[Cypher planner
----

.Merge nodes and relationships using dynamic node labels and relationship types
// tag::clauses_merge_dynamic_merge[]
[source, cypher]
----
MERGE (greta:$($nodeLabels) {name: 'Greta Gerwig'})
Expand All @@ -725,6 +726,7 @@ UNWIND $movies AS movieTitle
MERGE (greta)-[rel:$($relType)]->(m:Movie {title: movieTitle})
RETURN greta.name AS name, labels(greta) AS labels, type(rel) AS relType, collect(m.title) AS movies
----
// end::clauses_merge_dynamic_merge[]

.Result
[role="queryresult",options="footer",cols="3*<m"]
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/constraints/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The following constraints are available in Neo4j:

* *Property uniqueness constraints* ensure that the combined property values are unique for all nodes with a specific label or all relationships with a specific type.
* *Property existence constraints* ensure that a property exists either for all nodes with a specific label or for all relationships with a specific type. label:enterprise-edition[]
* *Property type constraints* ensure that a property has the required property type for all nodes with a specific label or for all relationships with a specific type. label:enterprise-edition[]
* *Property type constraints* ensure that a property has the required property type for all nodes with a specific label or for all relationships with a specific type. label:new[Introduced in 5.9] label:enterprise-edition[]
* *Key constraints* ensure that all properties exist and that the combined property values are unique for all nodes with a specific label or all relationships with a specific type.label:enterprise-edition[]

To learn more about creating, listing, and dropping these constraints, as well as information about index-backed constraints, constraint creation failures and data violation scenarios, and more, see xref:constraints/managing-constraints.adoc[].
Expand Down
3 changes: 2 additions & 1 deletion modules/ROOT/pages/constraints/managing-constraints.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
:description: Information about creating, listing, and dropping Neo4j's constraints.
:page-aliases: constraints/examples.adoc
include::https://raw.githubusercontent.com/neo4j-graphacademy/courses/main/asciidoc/courses/cypher-indexes-constraints/ad.adoc[]
:page-aliases: constraints/examples.adoc
= Create, show, and drop constraints
Expand All @@ -8,7 +9,7 @@ The following constraint types are available in Neo4j:

* xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[Property uniqueness constraints]
* xref:constraints/managing-constraints.adoc#create-property-existence-constraints[Property existence constraints] label:enterprise-edition[]
* xref:constraints/managing-constraints.adoc#create-property-type-constraints[Property type constraints] label:enterprise-edition[]
* xref:constraints/managing-constraints.adoc#create-property-type-constraints[Property type constraints] label:new[Introduced in 5.9] label:enterprise-edition[]
* xref:constraints/managing-constraints.adoc#create-key-constraints[Key constraints] label:enterprise-edition[]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ MATCH (n)-[r:REL]->(m) SET n = properties(r)
| Feature
| Details

a|
label:functionality[]
label:updated[]
[source, cypher, role=noheader]
----
MATCH SHORTEST $param (:A)-[:R]->{0,10}(:B)
----

[source, cypher, role=noheader]
----
MATCH p = ANY $param (:A)-[:R]->{0,10}(:B)
----

[source, cypher, role=noheader]
----
MATCH SHORTEST $param GROUPS (:A)-[:R]->{0,10}(:B)
----

a| Introduced the allowance of parameters to the xref:patterns/shortest-paths.adoc[SHORTEST and ANY path patterns].

a|
label:functionality[]
label:updated[]
Expand Down Expand Up @@ -375,6 +395,45 @@ Also introduced the ability to specify CSV columns dynamically when using xref:c
|===


=== New features

[cols="2", options="header"]
|===
| Feature
| Details

a|
label:functionality[]
label:new[]
[source, cypher, role="noheader"]
----
MATCH (n:$($label)),
()-[r:$($type))]->()
----

[source, cypher, role="noheader"]
----
CREATE (n:$($label)),
()-[r:$($type)]->()
----

[source, cypher, role="noheader"]
----
MERGE (n:$($label)),
()-[r:$($type)]->()
----

[source, cypher, role="noheader"]
----
LOAD CSV WITH HEADERS FROM 'file:///artists-with-headers.csv' AS line
CREATE (n:$(line.label) {name: line.Name})
----

| Added the ability to dynamically reference node labels and relationship types in xref:clauses/match.adoc#dynamic-match[`MATCH`], xref:clauses/create.adoc#dynamic-create[`CREATE`], and xref:clauses/merge.adoc#dynamic-merge[`MERGE`] clauses.
Also introduced the ability to specify CSV columns dynamically when using xref:clauses/load-csv.adoc#dynamic-load[`LOAD CSV`].
|===


[[cypher-deprecations-additions-removals-5.25]]
== Neo4j 5.25

Expand Down Expand Up @@ -415,6 +474,27 @@ The maximum limit is set to 16,383 characters in an identifier.
This means that node labels, relationship types, and property keys cannot include more than 16,383 characters.
|===

=== Updated features

[cols="2", options="header"]
|===
| Feature
| Details

a|
label:functionality[]
label:updated[]
[source, cypher, role="noheader"]
----
CREATE (n:Label {property: 'name'}),
()-[r:REL_TYPE]->()
----
| Neo4j's link:{neo4j-docs-base-uri}/operations-manual/{page-version}/database-internals/store-formats/#store-format-overview[block format] now implements xref:appendix/gql-conformance/index.adoc[GQL's] limit on the maximum length of identifiers.

The maximum limit is set to 16,383 characters in an identifier.
This means that node labels, relationship types, and property keys cannot include more than 16,383 characters.
|===

=== New features

[cols="2", options="header"]
Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/patterns/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1165,10 +1165,10 @@ anyPathSearch ::= "ANY" [ numberOfPaths ] [ pathOrPaths ]
pathOrPaths ::= { "PATH" | "PATHS" }


numberOfPaths ::= unsignedDecimalInteger
numberOfPaths ::= unsignedDecimalInteger | parameter


numberOfGroups ::= unsignedDecimalInteger
numberOfGroups ::= unsignedDecimalInteger | parameter
----

[NOTE]
Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/patterns/shortest-paths.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Use Cypher if:

* You need to specify complex graph navigation via xref:patterns/variable-length-patterns.adoc#quantified-path-patterns[quantified path patterns].
* Creating a link:https://neo4j.com/docs/graph-data-science/current/management-ops/graph-creation/graph-project/[graph projection] takes too long.
* GDS is not available in your instance, or the size of the GDS projection is too large for your instance.
* GDS is not available in your instance, or the size of the GDS projection is too large for your instance.

Use GDS if:

Expand Down Expand Up @@ -64,7 +64,7 @@ CREATE (asc)-[:LINK {distance: 7.25}]->(cnm),
(wof)-[:LINK {distance: 0.65}]->(wos)
----

The paths matched by a xref:patterns/fixed-length-patterns.adoc#path-patterns[path pattern] can be restricted to only the shortest (by number of hops) by including the keyword `SHORTEST k`, where `k` is the number of paths to match.
The paths matched by a xref:patterns/fixed-length-patterns.adoc#path-patterns[path pattern] can be restricted to only the shortest (by number of hops) by including the keyword `SHORTEST k`, where `k` is the number of paths to match, and can be either an `INTEGER` literal or a parameter which resolves to an `INTEGER`.
For example, the following example uses `SHORTEST 1` to return the length of the shortest path between `Worcester Shrub Hill` and `Bromsgrove`:

.Query
Expand Down
Loading