diff --git a/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc b/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc index 6731cb737..6e7f49ec1 100644 --- a/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc +++ b/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc @@ -206,7 +206,8 @@ REMOVE n:$($label) | Description | xref:functions/graph.adoc#functions-graph-by-elementid[`graph.byElementId()`] -| Returns the graph reference with the given element id. It is only supported in the `USE` clause, on composite databases. +| Returns the graph reference with the given element id. +It is only supported in the xref:clauses/use.adoc[`USE`] clause. | xref:functions/graph.adoc#functions-graph-byname[`graph.byName()`] | Returns the graph reference of the given name. It is only supported in the `USE` clause, on composite databases. diff --git a/modules/ROOT/pages/clauses/use.adoc b/modules/ROOT/pages/clauses/use.adoc index 4f1811d20..7433484ce 100644 --- a/modules/ROOT/pages/clauses/use.adoc +++ b/modules/ROOT/pages/clauses/use.adoc @@ -92,7 +92,7 @@ MATCH (n) RETURN n [[query-use-examples-query-composite-database-constituent-graph-dynamically]] === Query a composite database constituent graph dynamically -The built-in function `graph.byName()` can be used in the `USE` clause to resolve a constituent graph from a `STRING` value containing the qualified name of a constituent. +The xref:functions/graph.adoc#functions-graph-byname[`graph.byName()`] function can be used in the `USE` clause to resolve a constituent graph from a `STRING` value containing the qualified name of a constituent. This example uses a composite database named `myComposite` that includes an alias named `myConstituent`: @@ -116,9 +116,13 @@ MATCH (n) RETURN n [[query-use-examples-query-composite-database-by-element-id]] === Query a composite database constituent using elementId -The `graph.byElementId()` function, can be used in the `USE` clause to resolve a constituent graph to which a given element id belongs. -In the below example, it is assumed that the DBMS contains a composite database constituent, which contains the element id `4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0`. -If the constituent database is not a standard database in the DBMS an error will be thrown: +The xref:functions/graph.adoc#functions-graph-by-elementid[`graph.byElementId()`] function can be used in the `USE` clause to resolve a constituent graph to which a given xref:functions/scalar.adoc#functions-elementid[element id] belongs. + +[NOTE] +On a standard database, a `USE` clause with `graph.byElementId()` cannot be combined with other `USE` clauses unless the subsequent `USE` clauses reference the same element id. + +In the below example, it is assumed that the DBMS contains the database corresponding to the given element id. If you are connected to a composite database it needs to be a element id to a constituent database, which is a standard database in the DBMS. + .Query [source, cypher, role=test-skip] ---- diff --git a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc index 780cfaf1f..b674532d7 100644 --- a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc +++ b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc @@ -278,6 +278,18 @@ For more information on the deprecation of these formats, see link:{neo4j-docs-b | Feature | Details +a| +label:functionality[] +label:updated[] +[source, cypher, role="noheader"] +---- +USE graph.byElementId("4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0") +MATCH (n) RETURN n +---- + +| xref:functions/graph.adoc#functions-graph-by-elementid[`graph.byElementId()`] can now be used on both link:{neo4j-docs-base-uri}/operations-manual/{page-version}/database-administration/[standard and composite databases]. +Previously it could only be used on composite databases. + a| label:functionality[] label:updated[] diff --git a/modules/ROOT/pages/functions/graph.adoc b/modules/ROOT/pages/functions/graph.adoc index 3d7b7028d..57545af0f 100644 --- a/modules/ROOT/pages/functions/graph.adoc +++ b/modules/ROOT/pages/functions/graph.adoc @@ -144,12 +144,18 @@ For more information, see xref:subqueries/call-subquery.adoc#import-variables[CA .Details |=== | *Syntax* 3+| `graph.byName(name)` -| *Description* 3+| Returns the graph reference of the given name. It is only supported in the `USE` clause, on composite databases. +| *Description* 3+| Returns the graph reference of the given name. .2+| *Arguments* | *Name* | *Type* | *Description* | `name` | `STRING` | The name of the graph to be resolved. | *Returns* 3+| `GRAPH` |=== + +.Considerations +|=== +| `graph.byName()` is only supported in the xref:clauses/use.adoc[`USE`] clause, on composite databases. +|=== + .+graph.byName()+ ====== @@ -178,7 +184,7 @@ Returns all nodes from all graphs on the current composite database. .Details |=== | *Syntax* 3+| `graph.byElementId(elementId)` -| *Description* 3+| Returns the graph reference with the given element id. It is only supported in the `USE` clause, on composite databases. +| *Description* 3+| Returns the graph reference with the given element id. .2+| *Arguments* | *Name* | *Type* | *Description* | `elementId` | `STRING` | An element id of a node or relationship. | *Returns* 3+| `GRAPH` @@ -187,6 +193,9 @@ Returns all nodes from all graphs on the current composite database. .Considerations |=== | If the constituent database is not a standard database in the DBMS, an error will be thrown. +| `graph.byElementId()` is only supported in the xref:clauses/use.adoc[`USE`] clause. +| `graph.byElementId()` is supported on both link:{neo4j-docs-base-uri}/operations-manual/{page-version}/database-administration/[standard and composite databases]. +| On a standard database, a `USE` clause with `graph.byElementId()` cannot be combined with other `USE` clauses unless the subsequent `USE` clauses reference the same element id. |=== .+graph.byElementId()+