From c8d0a5918f205d074a2d8603db466cec67ddacf2 Mon Sep 17 00:00:00 2001 From: Gemma Lamont Date: Thu, 16 Nov 2023 14:28:09 +0100 Subject: [PATCH] Add docs for new normalize function. --- ...ions-additions-removals-compatibility.adoc | 21 ++- modules/ROOT/pages/functions/index.adoc | 6 + modules/ROOT/pages/functions/string.adoc | 130 ++++++++++++++++++ 3 files changed, 156 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc index 139144ec4..a143ed7f3 100644 --- a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc +++ b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc @@ -70,6 +70,25 @@ For more information, see the link:{neo4j-docs-base-uri}/operations-manual/{page |=== +[cols="2", options="header"] +|=== +| Feature +| Details + +a| +label:functionality[] +label:new[] + +[source, cypher, role=noheader] +---- +RETURN normalize("string", NFC) +---- + +| Introduction of a xref::functions/string.adoc#functions-normalize[normalize()] function. +Normalize a `STRING` according to the specified normalization form, which can be of type `NFC`, `NFD`, `NFKC` or `NFKD`. + +|=== + [[cypher-deprecations-additions-removals-5.15]] == Neo4j 5.15 @@ -146,7 +165,7 @@ label:updated[] MATCH (n:Label) WHERE $param IS :: STRING NOT NULL AND n.prop = $param ---- -| `IS :: STRING NOT NULL` is now an xref:planning-and-tuning/query-tuning/indexes.adoc#text-index-type-predicate-expressions[index-compatible predicate]. +| `IS :: STRING NOT NULL` is now an xref:planning-and-tuning/query-tuning/indexes.adoc#text-index-type-predicate-expressions[index-compatible predicate]. |=== diff --git a/modules/ROOT/pages/functions/index.adoc b/modules/ROOT/pages/functions/index.adoc index 55450b53c..3e6623186 100644 --- a/modules/ROOT/pages/functions/index.adoc +++ b/modules/ROOT/pages/functions/index.adoc @@ -496,6 +496,12 @@ These functions are used to manipulate strings or to create a string representat | `ltrim(input :: STRING) :: STRING` | Returns the given `STRING` with leading whitespace removed. +1.2+| xref::functions/string.adoc#functions-normalize[`normalize()`] +| `normalize(input :: STRING) :: STRING` +| Returns the given `STRING` normalized using the normal form 'NFC'. +| `normalize(input :: STRING, normalForm = NFC :: [NFC, NFD, NFKC, NFKD]) :: STRING` +| Returns the given `STRING` normalized according to the specified normalization form. + 1.1+| xref::functions/string.adoc#functions-replace[`replace()`] | `replace(original :: STRING, search :: STRING, replace :: STRING) :: STRING` | Returns a `STRING` in which all occurrences of a specified search `STRING` in the given `STRING` have been replaced by another (specified) replacement `STRING`. diff --git a/modules/ROOT/pages/functions/string.adoc b/modules/ROOT/pages/functions/string.adoc index ee3009dbf..6f770d0bf 100644 --- a/modules/ROOT/pages/functions/string.adoc +++ b/modules/ROOT/pages/functions/string.adoc @@ -148,6 +148,136 @@ RETURN ltrim(' hello') ====== + + +[[functions-normalize]] +== normalize() + +`normalize()` returns the given `STRING` normalized using the `NFC` normalization form. + +*Syntax:* + +[source, syntax, role="noheader"] +---- +normalize(input) +---- + +*Returns:* + +|=== + +| `STRING` + +|=== + +*Arguments:* + +[options="header"] +|=== +| Name | Description + +| `input` +| An expression that returns a `STRING`. + +|=== + +*Considerations:* + +|=== + +| `normalize(null)` returns `null`. + +|=== + + +.+normalize()+ +====== + +.Query +[source, cypher, indent=0] +---- +RETURN normalize('\u212B') = '\u00C5' AS result +---- + +.Result +[role="queryresult",options="header,footer",cols="1*