|
6 | 6 |
|
7 | 7 | Scalar functions return a single value. |
8 | 8 |
|
9 | | - |
10 | 9 | [IMPORTANT] |
11 | 10 | ==== |
12 | 11 | The `length()` and `size()` functions are quite similar, and so it is important to take note of the difference. |
@@ -191,8 +190,8 @@ However, no guarantees are given regarding the order of the returned ID values o |
191 | 190 | Outside of the scope of a single transaction, no guarantees are given about the mapping between ID values and elements. |
192 | 191 |
|
193 | 192 | . Neo4j reuses its internal IDs when nodes and relationships are deleted. |
194 | | -This means that applications using, and relying on internal Neo4j IDs, are brittle or at risk of making mistakes. |
195 | | -It is therefore recommended to rather use application-generated IDs. |
| 193 | +Applications relying on internal Neo4j IDs are, as a result, brittle and can be inaccurate. |
| 194 | +It is therefore recommended to use application-generated IDs. |
196 | 195 |
|
197 | 196 |
|
198 | 197 | .Considerations |
@@ -361,22 +360,29 @@ It is recommended to use xref:functions/scalar.adoc#functions-elementid[`element |
361 | 360 |
|
362 | 361 | |=== |
363 | 362 |
|
364 | | -The function `id()` returns a node or a relationship identifier, unique by an object type and a database. |
| 363 | +There are important considerations to bear in mind when using `id()`: |
| 364 | + |
| 365 | +. The function `id()` returns a node or a relationship identifier, unique by an object type and a database. |
365 | 366 | Therefore, `id()` can return the same value for both nodes and relationships in the same database. |
366 | 367 |
|
367 | | -Neo4j implements the id so that every node and relationship in a database has an identifier. |
| 368 | +. Neo4j implements the ID so that every node and relationship in a database has an identifier. |
368 | 369 | The identifier for a node or relationship is guaranteed to be unique among other nodes' and relationships' identifiers in the same database, within the scope of a single transaction. |
369 | 370 |
|
| 371 | +. Neo4j reuses its internal IDs when nodes and relationships are deleted. |
| 372 | +Applications relying on internal Neo4j IDs are, as a result, brittle and can be inaccurate. |
| 373 | +It is therefore recommended to use application-generated IDs instead. |
| 374 | + |
| 375 | + |
370 | 376 | [NOTE] |
371 | 377 | ==== |
372 | 378 | On a link:{neo4j-docs-base-uri}/operations-manual/{page-version}/database-administration/composite-databases/concepts/[composite database], the `id()` function should be used with caution. |
373 | 379 | It is recommended to use xref:functions/scalar.adoc#functions-elementid[`elementId()`] instead. |
374 | 380 |
|
375 | | -When called in database-specific subqueries, the resulting id value for a node or relationship is local to that database. |
376 | | -The local id for nodes or relationships from different databases may be the same. |
| 381 | +When called in database-specific subqueries, the resulting ID value for a node or relationship is local to that database. |
| 382 | +The local ID for nodes or relationships from different databases may be the same. |
377 | 383 |
|
378 | | -When called from the root context of a query, the resulting value is an extended id for the node or relationship. |
379 | | -The extended id is likely different from the local id for the same node or relationship. |
| 384 | +When called from the root context of a query, the resulting value is an extended ID for the node or relationship. |
| 385 | +The extended ID is likely different from the local ID for the same node or relationship. |
380 | 386 | ==== |
381 | 387 |
|
382 | 388 |
|
|
0 commit comments