Skip to content

Commit 9a713c6

Browse files
graph.byElemendId (neo4j#1121)
1 parent e5158f1 commit 9a713c6

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ REMOVE n:$($label)
206206
| Description
207207

208208
| xref:functions/graph.adoc#functions-graph-by-elementid[`graph.byElementId()`]
209-
| Returns the graph reference with the given element id. It is only supported in the `USE` clause, on composite databases.
209+
| Returns the graph reference with the given element id.
210+
It is only supported in the xref:clauses/use.adoc[`USE`] clause.
210211

211212
| xref:functions/graph.adoc#functions-graph-byname[`graph.byName()`]
212213
| Returns the graph reference of the given name. It is only supported in the `USE` clause, on composite databases.

modules/ROOT/pages/clauses/use.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ MATCH (n) RETURN n
9292
[[query-use-examples-query-composite-database-constituent-graph-dynamically]]
9393
=== Query a composite database constituent graph dynamically
9494

95-
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.
95+
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.
9696

9797
This example uses a composite database named `myComposite` that includes an alias named `myConstituent`:
9898

@@ -116,9 +116,13 @@ MATCH (n) RETURN n
116116
[[query-use-examples-query-composite-database-by-element-id]]
117117
=== Query a composite database constituent using elementId
118118

119-
The `graph.byElementId()` function, can be used in the `USE` clause to resolve a constituent graph to which a given element id belongs.
120-
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`.
121-
If the constituent database is not a standard database in the DBMS an error will be thrown:
119+
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.
120+
121+
[NOTE]
122+
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.
123+
124+
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.
125+
122126
.Query
123127
[source, cypher, role=test-skip]
124128
----

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,18 @@ For more information on the deprecation of these formats, see link:{neo4j-docs-b
278278
| Feature
279279
| Details
280280

281+
a|
282+
label:functionality[]
283+
label:updated[]
284+
[source, cypher, role="noheader"]
285+
----
286+
USE graph.byElementId("4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0")
287+
MATCH (n) RETURN n
288+
----
289+
290+
| 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].
291+
Previously it could only be used on composite databases.
292+
281293
a|
282294
label:functionality[]
283295
label:updated[]

modules/ROOT/pages/functions/graph.adoc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,18 @@ For more information, see xref:subqueries/call-subquery.adoc#import-variables[CA
144144
.Details
145145
|===
146146
| *Syntax* 3+| `graph.byName(name)`
147-
| *Description* 3+| Returns the graph reference of the given name. It is only supported in the `USE` clause, on composite databases.
147+
| *Description* 3+| Returns the graph reference of the given name.
148148
.2+| *Arguments* | *Name* | *Type* | *Description*
149149
| `name` | `STRING` | The name of the graph to be resolved.
150150
| *Returns* 3+| `GRAPH`
151151
|===
152152

153+
154+
.Considerations
155+
|===
156+
| `graph.byName()` is only supported in the xref:clauses/use.adoc[`USE`] clause, on composite databases.
157+
|===
158+
153159
.+graph.byName()+
154160
======
155161
@@ -178,7 +184,7 @@ Returns all nodes from all graphs on the current composite database.
178184
.Details
179185
|===
180186
| *Syntax* 3+| `graph.byElementId(elementId)`
181-
| *Description* 3+| Returns the graph reference with the given element id. It is only supported in the `USE` clause, on composite databases.
187+
| *Description* 3+| Returns the graph reference with the given element id.
182188
.2+| *Arguments* | *Name* | *Type* | *Description*
183189
| `elementId` | `STRING` | An element id of a node or relationship.
184190
| *Returns* 3+| `GRAPH`
@@ -187,6 +193,9 @@ Returns all nodes from all graphs on the current composite database.
187193
.Considerations
188194
|===
189195
| If the constituent database is not a standard database in the DBMS, an error will be thrown.
196+
| `graph.byElementId()` is only supported in the xref:clauses/use.adoc[`USE`] clause.
197+
| `graph.byElementId()` is supported on both link:{neo4j-docs-base-uri}/operations-manual/{page-version}/database-administration/[standard and composite databases].
198+
| 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.
190199
|===
191200

192201
.+graph.byElementId()+

0 commit comments

Comments
 (0)