From 7d001d0d15db14553d3f3d79b4ff03109ad17be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:29:27 +0100 Subject: [PATCH] Update elementId() (#831) --- modules/ROOT/pages/functions/index.adoc | 13 +++++- modules/ROOT/pages/functions/scalar.adoc | 58 +++++++++++++----------- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/modules/ROOT/pages/functions/index.adoc b/modules/ROOT/pages/functions/index.adoc index 2a6880c41..dc83a738f 100644 --- a/modules/ROOT/pages/functions/index.adoc +++ b/modules/ROOT/pages/functions/index.adoc @@ -104,6 +104,12 @@ label:new[Introduced in 5.13] | `coalesce(input :: ANY) :: ANY` | Returns the first non-null value in a list of expressions. +1.2+| xref::functions/scalar.adoc#functions-elementid[`elementId()`] +| `elementId(input :: NODE) :: STRING` +| Returns a node identifier, unique within a specific transaction and DBMS. +| `elementId(input :: RELATIONSHIP) :: STRING` +| Returns a relationship identifier, unique within a specific transaction and DBMS. + 1.1+| xref::functions/scalar.adoc#functions-endnode[`endNode()`] | `endNode(input :: RELATIONSHIP) :: NODE` | Returns the end `NODE` of a `RELATIONSHIP`. @@ -114,9 +120,12 @@ label:new[Introduced in 5.13] 1.2+| xref::functions/scalar.adoc#functions-id[`id()`] | `id(input :: NODE) :: INTEGER` -| label:deprecated[] Returns the id of a `NODE`. Replaced by `elementId()` +| label:deprecated[] Returns the id of a `NODE`. +Replaced by xref:functions/scalar.adoc#functions-elementid[`elementId()`]. | `id(input :: RELATIONSHIP) :: INTEGER` -| label:deprecated[] Returns the id of a `RELATIONSHIP`. Replaced by `elementId()`. +| label:deprecated[] Returns the id of a `RELATIONSHIP`. +Replaced by xref:functions/scalar.adoc#functions-elementid[`elementId()`]. + 1.1+| xref::functions/scalar.adoc#functions-last[`last()`] | `last(list :: LIST) :: ANY` diff --git a/modules/ROOT/pages/functions/scalar.adoc b/modules/ROOT/pages/functions/scalar.adoc index 52953fd76..1200f01c5 100644 --- a/modules/ROOT/pages/functions/scalar.adoc +++ b/modules/ROOT/pages/functions/scalar.adoc @@ -282,46 +282,50 @@ elementId(expression) |=== -.+elementId()+ +.+elementId() for nodes+ ====== -//// -CREATE - (alice:Developer {name:'Alice', age: 38, eyes: 'brown'}), - (bob {name: 'Bob', age: 25, eyes: 'blue'}), - (charlie {name: 'Charlie', age: 53, eyes: 'green'}), - (daniel {name: 'Daniel', age: 54, eyes: 'brown'}), - (eskil {name: 'Eskil', age: 41, eyes: 'blue', liked_colors: ['pink', 'yellow', 'black']}), - (alice)-[:KNOWS]->(bob), - (alice)-[:KNOWS]->(charlie), - (bob)-[:KNOWS]->(daniel), - (charlie)-[:KNOWS]->(daniel), - (bob)-[:MARRIED]->(eskil) -//// - .Query [source, cypher] ---- -MATCH (a) -RETURN elementId(a) +MATCH (n:Developer) +RETURN elementId(n) ---- -The node identifier for each of the nodes is returned. +The identifier for each `Developer` node is returned. .Result [role="queryresult",options="header,footer",cols="1*