From 73daebe0d66f3f43e0131f83f5b27f41d43ab30c Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Tue, 9 Jul 2024 09:53:02 +0200 Subject: [PATCH 01/22] tags for the first aggregating function (avg) --- modules/ROOT/pages/functions/aggregating.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ROOT/pages/functions/aggregating.adoc b/modules/ROOT/pages/functions/aggregating.adoc index 23ddda5b2..224d75ff3 100644 --- a/modules/ROOT/pages/functions/aggregating.adoc +++ b/modules/ROOT/pages/functions/aggregating.adoc @@ -80,10 +80,12 @@ avg(expression) .Query [source, cypher] +// tag::functions_aggregating_avg[] ---- MATCH (p:Person) RETURN avg(p.age) ---- +// end::functions_aggregating_avg[] The average of all the values in the property `age` is returned: From 807e331096c0094bd847f87aef84a648ea9e84c4 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Tue, 9 Jul 2024 14:07:59 +0200 Subject: [PATCH 02/22] more tags for aggregate functions --- modules/ROOT/pages/functions/aggregating.adoc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/ROOT/pages/functions/aggregating.adoc b/modules/ROOT/pages/functions/aggregating.adoc index 224d75ff3..6076a0aa3 100644 --- a/modules/ROOT/pages/functions/aggregating.adoc +++ b/modules/ROOT/pages/functions/aggregating.adoc @@ -148,10 +148,12 @@ avg(expression) .Query [source, cypher] +// tag::functions_aggregating_duration_avg[] ---- UNWIND [duration('P2DT3H'), duration('PT1H45S')] AS dur RETURN avg(dur) ---- +// end::functions_aggregating_duration_avg[] The average of the two supplied `DURATION` values is returned: @@ -214,10 +216,12 @@ collect(expression) .Query [source, cypher] +// tag::functions_aggregating_collect[] ---- MATCH (p:Person) RETURN collect(p.age) ---- +// end::functions_aggregating_collect[] All the values are collected and returned in a single list: @@ -291,10 +295,12 @@ The function `count(*)` can be used to return the number of nodes; for example, .Query [source, cypher] +// tag::functions_aggregating_count[] ---- MATCH (p:Person {name: 'Keanu Reeves'})-->(x) RETURN labels(p), p.age, count(*) ---- +// end::functions_aggregating_count[] The labels and `age` property of the start node `Keanu Reeves` and the number of nodes related to it are returned: @@ -350,10 +356,12 @@ Instead of simply returning the number of rows with `count(*)`, the function `co .Query [source, cypher] +// tag::functions_aggregating_count_as_expression[] ---- MATCH (p:Person) RETURN count(p.age) ---- +// end::functions_aggregating_count_as_expression[] The number of nodes with the label `Person` and a property `age` is returned: (To calculate the sum, use `sum(n.age)`) @@ -509,10 +517,12 @@ The highest of all the lists in the set -- in this case, the list `[1, 2]` -- is .Query [source, cypher] +// tag::functions_aggregating_max[] ---- MATCH (p:Person) RETURN max(p.age) ---- +// end::functions_aggregating_max[] The highest of all the values in the property `age` is returned: @@ -625,10 +635,12 @@ The lowest of all the values in the set -- in this case, the list `['a', 'c', 23 .Query [source, cypher] +// tag::functions_aggregating_min[] ---- MATCH (p:Person) RETURN min(p.age) ---- +// end::functions_aggregating_min[] The lowest of all the values in the property `age` is returned: @@ -693,10 +705,12 @@ percentileCont(expression, percentile) .Query [source, cypher] +// tag::functions_aggregating_percentile_cont[] ---- MATCH (p:Person) RETURN percentileCont(p.age, 0.4) ---- +// end::functions_aggregating_percentile_cont[] The 40th percentile of the values in the property `age` is returned, calculated with a weighted average: @@ -762,10 +776,12 @@ percentileDisc(expression, percentile) .Query [source, cypher] +// tag::functions_aggregating_percentile_disc[] ---- MATCH (p:Person) RETURN percentileDisc(p.age, 0.5) ---- +// end::functions_aggregating_percentile_disc[] The 50th percentile of the values in the property `age` is returned: @@ -827,11 +843,13 @@ stDev(expression) .Query [source, cypher] +// tag::functions_aggregating_stdev[] ---- MATCH (p:Person) WHERE p.name IN ['Keanu Reeves', 'Liam Neeson', 'Carrie Anne Moss'] RETURN stDev(p.age) ---- +// end::functions_aggregating_stdev[] The standard deviation of the values in the property `age` is returned: @@ -894,11 +912,13 @@ stDevP(expression) .Query [source, cypher] +// tag::functions_aggregating_stdevp[] ---- MATCH (p:Person) WHERE p.name IN ['Keanu Reeves', 'Liam Neeson', 'Carrie Anne Moss'] RETURN stDevP(p.age) ---- +// end::functions_aggregating_stdevp[] The population standard deviation of the values in the property `age` is returned: @@ -959,10 +979,12 @@ sum(expression) .Query [source, cypher] +// tag::functions_aggregating_sum[] ---- MATCH (p:Person) RETURN sum(p.age) ---- +// end::functions_aggregating_sum[] The sum of all the values in the property `age` is returned: @@ -1021,10 +1043,12 @@ sum(expression) .Query [source, cypher] +// tag::functions_aggregating_sum_duration[] ---- UNWIND [duration('P2DT3H'), duration('PT1H45S')] AS dur RETURN sum(dur) ---- +// end::functions_aggregating_sum_duration[] The sum of the two supplied Durations is returned: From a1a6ab76a11d0a2e5861894fe1a8c053dae30932 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Tue, 9 Jul 2024 14:48:14 +0200 Subject: [PATCH 03/22] database function tag --- modules/ROOT/pages/functions/database.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ROOT/pages/functions/database.adoc b/modules/ROOT/pages/functions/database.adoc index 73baa5567..0799d304d 100644 --- a/modules/ROOT/pages/functions/database.adoc +++ b/modules/ROOT/pages/functions/database.adoc @@ -15,10 +15,12 @@ The name of the database can only be returned if the provided element id belongs .Query [source, cypher, indent=0] +// tag::functions_database_name_from_element_id[] ---- WITH "2:efc7577d-022a-107c-a736-dbcdfc189c03:0" AS eid RETURN db.nameFromElementId(eid) AS name ---- +// end::functions_database_name_from_element_id[] Returns the name of the database which the element id belongs to. From 0bf1d0d69f97d495f5a3c1f1f491ade0f09a7e25 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Wed, 10 Jul 2024 08:26:21 +0200 Subject: [PATCH 04/22] duration tags --- modules/ROOT/pages/functions/temporal/duration.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ROOT/pages/functions/temporal/duration.adoc b/modules/ROOT/pages/functions/temporal/duration.adoc index d4be722f8..a4291897c 100644 --- a/modules/ROOT/pages/functions/temporal/duration.adoc +++ b/modules/ROOT/pages/functions/temporal/duration.adoc @@ -67,6 +67,7 @@ The map of the `DURATION` components as numeric expressions. .Query [source, cypher, indent=0] +// tag::functions_duration[] ---- UNWIND [ duration({days: 14, hours:16, minutes: 12}), @@ -78,6 +79,7 @@ duration({minutes: 1.5, seconds: 1, nanoseconds: 123456789}) ] AS aDuration RETURN aDuration ---- +// end::functions_duration[] .Result [role="queryresult",options="header,footer",cols="1* Date: Fri, 12 Jul 2024 10:56:19 +0200 Subject: [PATCH 05/22] duration include statement(s) --- modules/ROOT/pages/functions/temporal/duration.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/ROOT/pages/functions/temporal/duration.adoc b/modules/ROOT/pages/functions/temporal/duration.adoc index a4291897c..bf06b2f3b 100644 --- a/modules/ROOT/pages/functions/temporal/duration.adoc +++ b/modules/ROOT/pages/functions/temporal/duration.adoc @@ -144,6 +144,7 @@ duration(temporalAmount) .Query [source, cypher, indent=0] +// tag::functions_duration_from_string[] ---- UNWIND [ duration("P14DT16H12M"), @@ -154,6 +155,7 @@ duration("P2012-02-02T14:37:21.545") ] AS aDuration RETURN aDuration ---- +// end::functions_duration_from_string[] .Result [role="queryresult",options="header,footer",cols="1* Date: Mon, 15 Jul 2024 13:33:35 +0200 Subject: [PATCH 06/22] tags for graph functions --- modules/ROOT/pages/functions/graph.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ROOT/pages/functions/graph.adoc b/modules/ROOT/pages/functions/graph.adoc index 1e29f3c28..ed2341502 100644 --- a/modules/ROOT/pages/functions/graph.adoc +++ b/modules/ROOT/pages/functions/graph.adoc @@ -25,9 +25,11 @@ CREATE ALIAS composite.third FOR DATABASE dbc; .Query [source, cypher, indent=0] +// tag::functions_graph_names[] ---- RETURN graph.names() AS name ---- +// end::functions_graph_names[] The names of all graphs on the current composite database are returned. @@ -120,6 +122,7 @@ It is only supported in the xref:clauses/use.adoc[`USE` clause], on link:{neo4j- [source, cypher, indent=0] [source, cypher, role=noplay] +// tag::functions_graph_by_name[] ---- UNWIND graph.names() AS graphName CALL { @@ -129,6 +132,7 @@ CALL { } RETURN n ---- +// end::functions_graph_by_name[] Returns all nodes from all graphs on the current composite database. @@ -148,9 +152,11 @@ In this example, it is assumed that the DBMS contains a composite database const .Query [source, cypher, role=test-skip] +// tag::functions_graph_by_element_id[] ---- USE graph.byElementId("4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0") MATCH (n) RETURN n ---- +// end::functions_graph_by_element_id[] ====== From a3245b9fe539982fc247c44b137984c8df49682e Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Mon, 15 Jul 2024 13:51:42 +0200 Subject: [PATCH 07/22] tags for list functions --- modules/ROOT/pages/functions/list.adoc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/ROOT/pages/functions/list.adoc b/modules/ROOT/pages/functions/list.adoc index c7ae65b69..ead46d7ba 100644 --- a/modules/ROOT/pages/functions/list.adoc +++ b/modules/ROOT/pages/functions/list.adoc @@ -75,10 +75,12 @@ keys(expression) .Query [source, cypher] +// tag::functions_list_keys[] ---- MATCH (a) WHERE a.name = 'Alice' RETURN keys(a) ---- +// end::functions_list_keys[] A `LIST` containing the names of all the properties on the node bound to `a` is returned. @@ -143,10 +145,12 @@ labels(node) .Query [source, cypher] +// tag::functions_list_labels[] ---- MATCH (a) WHERE a.name = 'Alice' RETURN labels(a) ---- +// end::functions_list_labels[] A `LIST` containing all the labels of the node bound to `a` is returned. @@ -208,11 +212,13 @@ nodes(path) .Query [source, cypher] +// tag::functions_list_nodes[] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND c.name = 'Eskil' RETURN nodes(p) ---- +// end::functions_list_nodes[] A `LIST` containing all the nodes in the path `p` is returned. @@ -276,9 +282,11 @@ range(start, end [, step]) .Query [source, cypher] +// tag::functions_list_range[] ---- RETURN range(0, 10), range(2, 18, 3), range(0, 5, -1) ---- +// end::functions_list_range[] Three lists of numbers in the given ranges are returned. @@ -346,11 +354,13 @@ reduce(accumulator = initial, variable IN list | expression) .Query [source, cypher] +// tag::functions_list_reduce[] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND b.name = 'Bob' AND c.name = 'Daniel' RETURN reduce(totalAge = 0, n IN nodes(p) | totalAge + n.age) AS reduction ---- +// end::functions_list_reduce[] The `age` property of all `NODE` values in the `PATH` are summed and returned as a single value. @@ -412,11 +422,13 @@ relationships(path) .Query [source, cypher] +// tag::functions_list_relationships[] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND c.name = 'Eskil' RETURN relationships(p) ---- +// end::functions_list_relationships[] A `LIST` containing all the `RELATIONSHIP` values in the `PATH` `p` is returned. @@ -477,10 +489,12 @@ reverse(original) .Query [source, cypher] +// tag::functions_list_reverse[] ---- WITH [4923,'abc',521, null, 487] AS ids RETURN reverse(ids) ---- +// end::functions_list_reverse[] .Result [role="queryresult",options="header,footer",cols="1*` comprising all but the first element of the `array` property are returned. @@ -600,11 +616,13 @@ toBooleanList(list) .Query [source, cypher, indent=0] +// tag::functions_list_to_boolean_list[] ---- RETURN toBooleanList(null) as noList, toBooleanList([null, null]) as nullsInList, toBooleanList(['a string', true, 'false', null, ['A','B']]) as mixedList ---- +// end::functions_list_to_boolean_list[] .Result [role="queryresult",options="header,footer",cols="3* Date: Mon, 15 Jul 2024 15:19:12 +0200 Subject: [PATCH 08/22] tags for numerical math functions --- .../pages/functions/mathematical-numeric.adoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/ROOT/pages/functions/mathematical-numeric.adoc b/modules/ROOT/pages/functions/mathematical-numeric.adoc index 2685a830b..10719bd6c 100644 --- a/modules/ROOT/pages/functions/mathematical-numeric.adoc +++ b/modules/ROOT/pages/functions/mathematical-numeric.adoc @@ -73,9 +73,11 @@ abs(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_abs[] ---- MATCH (a), (e) WHERE a.name = 'Alice' AND e.name = 'Eskil' RETURN a.age, e.age, abs(a.age - e.age) ---- +// end::functions_mathematical_numeric_abs[] The absolute value of the age difference is returned. @@ -137,9 +139,11 @@ ceil(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_ceil[] ---- RETURN ceil(0.1) ---- +// end::functions_mathematical_numeric_ceil[] The ceil of `0.1` is returned. @@ -201,9 +205,11 @@ floor(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_floor[] ---- RETURN floor(0.9) ---- +// end::functions_mathematical_numeric_floor[] The floor of `0.9` is returned. @@ -263,9 +269,11 @@ isNaN(expression) .Query [source, cypher] +// tag::functions_mathematical_numeric_is_nan[] ---- RETURN isNaN(0/0.0) ---- +// end::functions_mathematical_numeric_is_nan[] `true` is returned since the value is `NaN`. @@ -308,9 +316,11 @@ rand() .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_rand[] ---- RETURN rand() ---- +// end::functions_mathematical_numeric_rand[] A random number is returned. @@ -372,9 +382,11 @@ round(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_round[] ---- RETURN round(3.141592) ---- +// end::functions_mathematical_numeric_round[] `3.0` is returned. @@ -456,9 +468,11 @@ round(expression, precision) .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_round_with_precision[] ---- RETURN round(3.141592, 3) ---- +// end::functions_mathematical_numeric_round_with_precision[] `3.142` is returned. @@ -826,9 +840,11 @@ sign(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_sign[] ---- RETURN sign(-17), sign(0.1) ---- +// end::functions_mathematical_numeric_sign[] The signs of `-17` and `0.1` are returned. From 28e8af75c99edfb0d84b7c8fc26fd8e398223b58 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Mon, 15 Jul 2024 16:23:49 +0200 Subject: [PATCH 09/22] tags for logarithmic math functions --- .../ROOT/pages/functions/mathematical-logarithmic.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/ROOT/pages/functions/mathematical-logarithmic.adoc b/modules/ROOT/pages/functions/mathematical-logarithmic.adoc index 964a0c1bd..607c199a4 100644 --- a/modules/ROOT/pages/functions/mathematical-logarithmic.adoc +++ b/modules/ROOT/pages/functions/mathematical-logarithmic.adoc @@ -32,9 +32,11 @@ e() .Query [source, cypher, indent=0] +// tag::functions_mathematical_logarithmic_e[] ---- RETURN e() ---- +// end::functions_mathematical_logarithmic_e[] The base of the natural logarithm, `e`, is returned. @@ -97,9 +99,11 @@ e(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_logarithmic_exp[] ---- RETURN exp(2) ---- +// end::functions_mathematical_logarithmic_exp[] `e` to the power of `2` is returned. @@ -162,9 +166,11 @@ log(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_logarithmic_log[] ---- RETURN log(27) ---- +// end::functions_mathematical_logarithmic_log[] The natural logarithm of `27` is returned. @@ -228,9 +234,11 @@ log10(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_logarithmic_log10[] ---- RETURN log10(27) ---- +// end::functions_mathematical_logarithmic_log10[] The common logarithm of `27` is returned. @@ -293,9 +301,11 @@ sqrt(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_logarithmic_sqrt[] ---- RETURN sqrt(256) ---- +// end::functions_mathematical_logarithmic_sqrt[] The square root of `256` is returned. From f66d1f54426e96e2bc78522f94987c1f223e370f Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Mon, 15 Jul 2024 16:51:34 +0200 Subject: [PATCH 10/22] tags for trigonometric math functions --- .../functions/mathematical-trigonometric.adoc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/ROOT/pages/functions/mathematical-trigonometric.adoc b/modules/ROOT/pages/functions/mathematical-trigonometric.adoc index 7dec9bc17..117a26574 100644 --- a/modules/ROOT/pages/functions/mathematical-trigonometric.adoc +++ b/modules/ROOT/pages/functions/mathematical-trigonometric.adoc @@ -50,9 +50,11 @@ acos(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_acos[] ---- RETURN acos(0.5) ---- +// end::functions_mathematical_trigonometric_acos[] The arccosine of `0.5` is returned. @@ -112,9 +114,11 @@ asin(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_asin[] ---- RETURN asin(0.5) ---- +// end::functions_mathematical_trigonometric_asin[] The arcsine of `0.5` is returned. @@ -174,9 +178,11 @@ atan(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_atan[] ---- RETURN atan(0.5) ---- +// end::functions_mathematical_trigonometric_atan[] The arctangent of `0.5` is returned. @@ -240,9 +246,11 @@ atan2(expression1, expression2) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_atan2[] ---- RETURN atan2(0.5, 0.6) ---- +// end::functions_mathematical_trigonometric_atan2[] The arctangent2 of `0.5` and `0.6` is returned. @@ -304,9 +312,11 @@ cos(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_cos[] ---- RETURN cos(0.5) ---- +// end::functions_mathematical_trigonometric_cos[] The cosine of `0.5` is returned. @@ -368,9 +378,11 @@ cot(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_cot[] ---- RETURN cot(0.5) ---- +// end::functions_mathematical_trigonometric_cot[] The cotangent of `0.5` is returned. @@ -431,9 +443,11 @@ degrees(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_degrees[] ---- RETURN degrees(3.14159) ---- +// end::functions_mathematical_trigonometric_degrees[] The number of degrees in something close to _pi_ is returned. @@ -495,9 +509,11 @@ haversin(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_haversin[] ---- RETURN haversin(0.5) ---- +// end::functions_mathematical_trigonometric_haversin[] The haversine of `0.5` is returned. @@ -577,9 +593,11 @@ pi() .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_pi[] ---- RETURN pi() ---- +// end::functions_mathematical_trigonometric_pi[] The constant _pi_ is returned. @@ -641,9 +659,11 @@ radians(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_radians[] ---- RETURN radians(180) ---- +// end::functions_mathematical_trigonometric_radians[] The number of radians in `180` degrees is returned (pi). @@ -704,9 +724,11 @@ sin(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_sin[] ---- RETURN sin(0.5) ---- +// end::functions_mathematical_trigonometric_sin[] The sine of `0.5` is returned. @@ -768,9 +790,11 @@ tan(expression) .Query [source, cypher, indent=0] +// tag::functions_mathematical_trigonometric_tan[] ---- RETURN tan(0.5) ---- +// end::functions_mathematical_trigonometric_tan[] The tangent of `0.5` is returned. From b4fac40b0d9d845d44aa91cc557c0c9a012dd149 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Mon, 15 Jul 2024 17:25:15 +0200 Subject: [PATCH 11/22] predicate function tags --- modules/ROOT/pages/functions/predicate.adoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/ROOT/pages/functions/predicate.adoc b/modules/ROOT/pages/functions/predicate.adoc index 62dc78846..c6d5ce90e 100644 --- a/modules/ROOT/pages/functions/predicate.adoc +++ b/modules/ROOT/pages/functions/predicate.adoc @@ -85,6 +85,7 @@ However, an implicit conversion will happen for single elements when passing nod .Query [source, cypher, indent=0] +// tag::functions_predicate_all[] ---- MATCH p = (a)-[*]->(b) WHERE @@ -93,6 +94,7 @@ WHERE AND all(x IN nodes(p) WHERE x.age < 60) RETURN p ---- +// end::functions_predicate_all[] All nodes in the returned paths will have a property `age` with a value lower than `60`: @@ -159,11 +161,13 @@ However, an implicit conversion will happen for single elements when passing nod .Query [source, cypher, indent=0] +// tag::functions_predicate_any[] ---- MATCH (p:Person) WHERE any(nationality IN p.nationality WHERE nationality = 'American') RETURN p ---- +// end::functions_predicate_any[] The query returns the `Person` nodes with the `nationality` property value `American`: @@ -226,12 +230,14 @@ exists(pattern) .Query [source, cypher, indent=0] +// tag::functions_predicate_exists[] ---- MATCH (p:Person) RETURN p.name AS name, exists((p)-[:ACTED_IN]->()) AS has_acted_in_rel ---- +// end::functions_predicate_exists[] This query returns the `name` property of every `Person` node, along with a boolean (`true` or `false`) indicating if those nodes have an `ACTED_IN` relationship in the graph. @@ -297,11 +303,13 @@ isEmpty(list) .Query [source, cypher] +// tag::functions_predicate_is_empty[] ---- MATCH (p:Person) WHERE NOT isEmpty(p.nationality) RETURN p.name, p.nationality ---- +// end::functions_predicate_is_empty[] This query returns every `Person` node in the graph with a set `nationality` property value (i.e., all `Person` nodes except for `Jessica Chastain`): @@ -475,6 +483,7 @@ However, an implicit conversion will happen for single elements when passing nod .Query [source, cypher, indent=0] +// tag::functions_predicate_none[] ---- MATCH p = (n)-[*]->(b) WHERE @@ -482,6 +491,7 @@ WHERE AND none(x IN nodes(p) WHERE x.age > 60) RETURN p ---- +// end::functions_predicate_none[] No node in the returned path has an `age` property with a greater value than `60`: @@ -545,6 +555,7 @@ single(variable IN list WHERE predicate) .Query [source, cypher, indent=0] +// tag::functions_predicate_single[] ---- MATCH p = (n)-->(b) WHERE @@ -552,6 +563,7 @@ WHERE AND single(x IN nodes(p) WHERE x.nationality = 'Northern Irish') RETURN p ---- +// end::functions_predicate_single[] In every returned path there is exactly one node which the `nationality` property value `Northern Irish`: From de325361974ba8b6fa03c0dfaa99d6ff160bc736 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Tue, 16 Jul 2024 10:16:22 +0200 Subject: [PATCH 12/22] tags for scalar functions --- modules/ROOT/pages/functions/scalar.adoc | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/modules/ROOT/pages/functions/scalar.adoc b/modules/ROOT/pages/functions/scalar.adoc index cb90dd063..42477ea2f 100644 --- a/modules/ROOT/pages/functions/scalar.adoc +++ b/modules/ROOT/pages/functions/scalar.adoc @@ -81,9 +81,11 @@ char_length(string) .Query [source, cypher, indent=0] +// tag::functions_scalar_char_length[] ---- RETURN char_length('Alice') ---- +// end::functions_scalar_char_length[] .Result [role="queryresult",options="header,footer",cols="1*(b)-->(c) WHERE a.name = 'Alice' RETURN length(p) ---- +// end::functions_scalar_length[] The length of the path `p` is returned. @@ -755,9 +773,11 @@ The null value is returned as the two parameters are equivalent. .Query [source, cypher, indent=0] +// tag::functions_scalar_null_if[] ---- RETURN nullIf("abc", "def") ---- +// end::functions_scalar_null_if[] The first parameter, "abc", is returned, as the two parameters are not equivalent. @@ -849,10 +869,12 @@ properties(expression) .Query [source, cypher, indent=0] +// tag::functions_scalar_properties[] ---- CREATE (p:Person {name: 'Stefan', city: 'Berlin'}) RETURN properties(p) ---- +// end::functions_scalar_properties[] .Result [role="queryresult",options="header,footer",cols="1*() WHERE n.name = 'Alice' RETURN type(r) ---- +// end::functions_scalar_type[] The relationship type of `r` is returned. @@ -1749,10 +1793,12 @@ See the xref::values-and-types/type-predicate.adoc[type predicate expression] fo .Query [source, cypher, indent=0] +// tag::functions_scalar_value_type[] ---- UNWIND ["abc", 1, 2.0, true, [date()]] AS value RETURN valueType(value) AS result ---- +// end::functions_scalar_value_type[] .Result [role="queryresult",options="header,footer",cols="1* Date: Tue, 16 Jul 2024 13:42:24 +0200 Subject: [PATCH 13/22] tags for string functions --- modules/ROOT/pages/functions/string.adoc | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/modules/ROOT/pages/functions/string.adoc b/modules/ROOT/pages/functions/string.adoc index 5799e7e87..2e1d23882 100644 --- a/modules/ROOT/pages/functions/string.adoc +++ b/modules/ROOT/pages/functions/string.adoc @@ -139,9 +139,11 @@ left(original, length) .Query [source, cypher, indent=0] +// tag::functions_string_left[] ---- RETURN left('hello', 3) ---- +// end::functions_string_left[] .Result [role="queryresult",options="header,footer",cols="1* Date: Tue, 16 Jul 2024 14:15:56 +0200 Subject: [PATCH 14/22] added tags for spatial functions --- modules/ROOT/pages/functions/spatial.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/ROOT/pages/functions/spatial.adoc b/modules/ROOT/pages/functions/spatial.adoc index 7243a0a72..65eb13f4a 100644 --- a/modules/ROOT/pages/functions/spatial.adoc +++ b/modules/ROOT/pages/functions/spatial.adoc @@ -130,6 +130,7 @@ The distance between two 3D points in the _WGS 84_ CRS is returned. .Query [source, cypher] +// tag::functions_spatial_point_distance[] ---- MATCH (t:TrainStation)-[:TRAVEL_ROUTE]->(o:Office) WITH @@ -137,6 +138,7 @@ WITH point({longitude: o.longitude, latitude: o.latitude}) AS officePoint RETURN round(point.distance(trainPoint, officePoint)) AS travelDistance ---- +// end::functions_spatial_point_distance[] The distance between the train station in Copenhagen and the Neo4j office in Malmo is returned. @@ -448,10 +450,12 @@ RETURN point({x: 2.3, y: 4.5, crs: 'WGS-84'}) AS point .Query [source, cypher] +// tag::functions_spatial_point_wgs_84_2d[] ---- MATCH (p:Office) RETURN point({longitude: p.longitude, latitude: p.latitude}) AS officePoint ---- +// end::functions_spatial_point_wgs_84_2d[] A 2D `POINT` representing the coordinates of the city of Malmo in the _WGS 84_ CRS is returned. @@ -553,9 +557,11 @@ point({longitude | x, latitude | y, height | z, [, crs][, srid]}) .Query [source, cypher] +// tag::functions_spatial_point_wgs_84_3d[] ---- RETURN point({longitude: 56.7, latitude: 12.78, height: 8}) AS point ---- +// end::functions_spatial_point_wgs_84_3d[] A 3D `POINT` with a `longitude` of `56.7`, a `latitude` of `12.78` and a height of `8` meters in the _WGS 84_ CRS is returned. @@ -628,9 +634,11 @@ point({x, y [, crs][, srid]}) .Query [source, cypher] +// tag::functions_spatial_point_cartesian_2d[] ---- RETURN point({x: 2.3, y: 4.5}) AS point ---- +// end::functions_spatial_point_cartesian_2d[] A 2D `POINT` with an `x` coordinate of `2.3` and a `y` coordinate of `4.5` in the _Cartesian_ CRS is returned. @@ -707,9 +715,11 @@ point({x, y, z, [, crs][, srid]}) .Query [source, cypher] +// tag::functions_spatial_point_cartesian_3d[] ---- RETURN point({x: 2.3, y: 4.5, z: 2}) AS point ---- +// end::functions_spatial_point_cartesian_3d[] A 3D `POINT` with an `x` coordinate of `2.3`, a `y` coordinate of `4.5` and a `z` coordinate of `2` in the _Cartesian_ CRS is returned. From d0c846b3b4f31fc9db43efe1641279a818ded29d Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Tue, 16 Jul 2024 14:19:04 +0200 Subject: [PATCH 15/22] closing tag --- modules/ROOT/pages/functions/spatial.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ROOT/pages/functions/spatial.adoc b/modules/ROOT/pages/functions/spatial.adoc index 65eb13f4a..eb54f64c9 100644 --- a/modules/ROOT/pages/functions/spatial.adoc +++ b/modules/ROOT/pages/functions/spatial.adoc @@ -265,6 +265,7 @@ Checking if a point in _Cartesian_ CRS is contained in the bounding box. .Query [source, cypher] +// tag::functions_spatial_point_within_bbox[] ---- WITH point({longitude: 12.53, latitude: 55.66}) AS lowerLeft, @@ -273,6 +274,7 @@ MATCH (t:TrainStation) WHERE point.withinBBox(point({longitude: t.longitude, latitude: t.latitude}), lowerLeft, upperRight) RETURN count(t) ---- +// end::functions_spatial_point_within_bbox[] Finds all train stations contained in a bounding box around Copenhagen. From c32e68dcc581b5d005c97392894ac862f246c4a0 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Tue, 16 Jul 2024 15:24:15 +0200 Subject: [PATCH 16/22] tags for temporal functions --- .../ROOT/pages/functions/temporal/index.adoc | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/modules/ROOT/pages/functions/temporal/index.adoc b/modules/ROOT/pages/functions/temporal/index.adoc index f86ec2c89..49d00151a 100644 --- a/modules/ROOT/pages/functions/temporal/index.adoc +++ b/modules/ROOT/pages/functions/temporal/index.adoc @@ -367,9 +367,11 @@ date([{timezone}]) .Query [source, cypher] +// tag::functions_temporal_date[] ---- RETURN date() AS currentDate ---- +// end::functions_temporal_date[] The current date is returned. @@ -449,9 +451,11 @@ date.transaction([{timezone}]) .Query [source, cypher] +// tag::functions_temporal_date_transaction[] ---- RETURN date.transaction() AS currentDate ---- +// end::functions_temporal_date_transaction[] .Result [role="queryresult",options="header,footer",cols="1* Date: Mon, 19 Aug 2024 16:22:51 +0200 Subject: [PATCH 17/22] added two tags, modified another, to test tag scope --- modules/ROOT/pages/functions/aggregating.adoc | 2 +- modules/ROOT/pages/functions/string.adoc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ROOT/pages/functions/aggregating.adoc b/modules/ROOT/pages/functions/aggregating.adoc index 0d2c9a97b..605741aaa 100644 --- a/modules/ROOT/pages/functions/aggregating.adoc +++ b/modules/ROOT/pages/functions/aggregating.adoc @@ -80,8 +80,8 @@ avg(expression) ====== .Query -[source, cypher] // tag::functions_aggregating_avg[] +[source, cypher] ---- MATCH (p:Person) RETURN avg(p.age) diff --git a/modules/ROOT/pages/functions/string.adoc b/modules/ROOT/pages/functions/string.adoc index 2e1d23882..ef3f03dde 100644 --- a/modules/ROOT/pages/functions/string.adoc +++ b/modules/ROOT/pages/functions/string.adoc @@ -71,9 +71,11 @@ btrim(original [, trimCharacterString]) .Query [source, cypher, indent=0] +// tag::functions_string_btrim[] ---- RETURN btrim(' hello '), btrim('xxyyhelloxyxy', 'xy') ---- +// end::functions_string_btrim[] .Result [role="queryresult",options="header,footer",cols="2* Date: Tue, 20 Aug 2024 13:54:19 +0200 Subject: [PATCH 18/22] added tags according to suggestions in the cheat sheet PR --- modules/ROOT/pages/functions/graph.adoc | 2 ++ modules/ROOT/pages/functions/mathematical-numeric.adoc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/ROOT/pages/functions/graph.adoc b/modules/ROOT/pages/functions/graph.adoc index ed2341502..20b8a723f 100644 --- a/modules/ROOT/pages/functions/graph.adoc +++ b/modules/ROOT/pages/functions/graph.adoc @@ -72,10 +72,12 @@ CREATE ALIAS composite.third FOR DATABASE dbc .Query [source, cypher, indent=0] +// tag::functions_graph_properties_by_name[] ---- UNWIND graph.names() AS name RETURN name, graph.propertiesByName(name) AS props ---- +// end::functions_graph_properties_by_name[] Properties for all graphs on the current composite database are returned. diff --git a/modules/ROOT/pages/functions/mathematical-numeric.adoc b/modules/ROOT/pages/functions/mathematical-numeric.adoc index 10719bd6c..b8d917e86 100644 --- a/modules/ROOT/pages/functions/mathematical-numeric.adoc +++ b/modules/ROOT/pages/functions/mathematical-numeric.adoc @@ -619,12 +619,14 @@ E.g. for precision 1, 2.15 is a tie as it has equal distance to 2.1 and 2.2, whi .Query [source, cypher, indent=0] +// tag::functions_mathematical_numeric_round_with_precision_and_rounding_mode[] ---- RETURN round(1.249, 1, 'UP') AS positive, round(-1.251, 1, 'UP') AS negative, round(1.25, 1, 'UP') AS positiveTie, round(-1.35, 1, 'UP') AS negativeTie ---- +// end::functions_mathematical_numeric_round_with_precision_and_rounding_mode[] The rounded values using precision 1 and rounding mode `UP` are returned. From 4c11afa882beda6b93088349929ad8f81e14bbb3 Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Tue, 20 Aug 2024 14:46:02 +0200 Subject: [PATCH 19/22] some added tags and a wording update --- modules/ROOT/pages/functions/string.adoc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/pages/functions/string.adoc b/modules/ROOT/pages/functions/string.adoc index ef3f03dde..28e3627c3 100644 --- a/modules/ROOT/pages/functions/string.adoc +++ b/modules/ROOT/pages/functions/string.adoc @@ -227,7 +227,8 @@ RETURN lower('HELLO') `ltrim()` returns the original `STRING` with leading `trimCharacterString` characters removed. As of Neo4j 5.20, a `trimCharacterString` can be specified. -If this is not specified all leading whitespace will be removed. +`trimCharacterString` is a set of characters and `ltrim()` removes any occurrences of these characters from the beginning of the original `STRING` until it discovers a character which is not in the set. +If `trimCharacterString` is not specified all leading whitespace will be removed. *Syntax:* @@ -355,9 +356,11 @@ normalize(input) .Query [source, cypher, indent=0] +// tag::functions_string_normalize[] ---- RETURN normalize('\u212B') = '\u00C5' AS result ---- +// end::functions_string_normalize[] .Result [role="queryresult",options="header,footer",cols="1* Date: Wed, 21 Aug 2024 10:04:38 +0200 Subject: [PATCH 20/22] placed tags outside of [source, cypher] scope --- modules/ROOT/pages/functions/aggregating.adoc | 24 +++++----- modules/ROOT/pages/functions/database.adoc | 2 +- modules/ROOT/pages/functions/graph.adoc | 8 ++-- modules/ROOT/pages/functions/list.adoc | 24 +++++----- .../functions/mathematical-logarithmic.adoc | 10 ++-- .../pages/functions/mathematical-numeric.adoc | 18 ++++---- .../functions/mathematical-trigonometric.adoc | 24 +++++----- modules/ROOT/pages/functions/predicate.adoc | 12 ++--- modules/ROOT/pages/functions/scalar.adoc | 46 +++++++++---------- modules/ROOT/pages/functions/spatial.adoc | 12 ++--- modules/ROOT/pages/functions/string.adoc | 34 +++++++------- .../pages/functions/temporal/duration.adoc | 12 ++--- .../ROOT/pages/functions/temporal/index.adoc | 40 ++++++++-------- 13 files changed, 133 insertions(+), 133 deletions(-) diff --git a/modules/ROOT/pages/functions/aggregating.adoc b/modules/ROOT/pages/functions/aggregating.adoc index 605741aaa..2624ba834 100644 --- a/modules/ROOT/pages/functions/aggregating.adoc +++ b/modules/ROOT/pages/functions/aggregating.adoc @@ -148,8 +148,8 @@ avg(expression) ====== .Query -[source, cypher] // tag::functions_aggregating_duration_avg[] +[source, cypher] ---- UNWIND [duration('P2DT3H'), duration('PT1H45S')] AS dur RETURN avg(dur) @@ -216,8 +216,8 @@ collect(expression) ====== .Query -[source, cypher] // tag::functions_aggregating_collect[] +[source, cypher] ---- MATCH (p:Person) RETURN collect(p.age) @@ -295,8 +295,8 @@ The function `count(*)` can be used to return the number of nodes; for example, ====== .Query -[source, cypher] // tag::functions_aggregating_count[] +[source, cypher] ---- MATCH (p:Person {name: 'Keanu Reeves'})-->(x) RETURN labels(p), p.age, count(*) @@ -356,8 +356,8 @@ Instead of simply returning the number of rows with `count(*)`, the function `co ====== .Query -[source, cypher] // tag::functions_aggregating_count_as_expression[] +[source, cypher] ---- MATCH (p:Person) RETURN count(p.age) @@ -517,8 +517,8 @@ The highest of all the lists in the set -- in this case, the list `[1, 2]` -- is ====== .Query -[source, cypher] // tag::functions_aggregating_max[] +[source, cypher] ---- MATCH (p:Person) RETURN max(p.age) @@ -635,8 +635,8 @@ The lowest of all the values in the set -- in this case, the list `['a', 'c', 23 ====== .Query -[source, cypher] // tag::functions_aggregating_min[] +[source, cypher] ---- MATCH (p:Person) RETURN min(p.age) @@ -705,8 +705,8 @@ percentileCont(expression, percentile) ====== .Query -[source, cypher] // tag::functions_aggregating_percentile_cont[] +[source, cypher] ---- MATCH (p:Person) RETURN percentileCont(p.age, 0.4) @@ -776,8 +776,8 @@ percentileDisc(expression, percentile) ====== .Query -[source, cypher] // tag::functions_aggregating_percentile_disc[] +[source, cypher] ---- MATCH (p:Person) RETURN percentileDisc(p.age, 0.5) @@ -843,8 +843,8 @@ stDev(expression) ====== .Query -[source, cypher] // tag::functions_aggregating_stdev[] +[source, cypher] ---- MATCH (p:Person) WHERE p.name IN ['Keanu Reeves', 'Liam Neeson', 'Carrie Anne Moss'] @@ -912,8 +912,8 @@ stDevP(expression) ====== .Query -[source, cypher] // tag::functions_aggregating_stdevp[] +[source, cypher] ---- MATCH (p:Person) WHERE p.name IN ['Keanu Reeves', 'Liam Neeson', 'Carrie Anne Moss'] @@ -979,8 +979,8 @@ sum(expression) ====== .Query -[source, cypher] // tag::functions_aggregating_sum[] +[source, cypher] ---- MATCH (p:Person) RETURN sum(p.age) @@ -1043,8 +1043,8 @@ sum(expression) ====== .Query -[source, cypher] // tag::functions_aggregating_sum_duration[] +[source, cypher] ---- UNWIND [duration('P2DT3H'), duration('PT1H45S')] AS dur RETURN sum(dur) diff --git a/modules/ROOT/pages/functions/database.adoc b/modules/ROOT/pages/functions/database.adoc index 0799d304d..6e2f55d26 100644 --- a/modules/ROOT/pages/functions/database.adoc +++ b/modules/ROOT/pages/functions/database.adoc @@ -14,8 +14,8 @@ The name of the database can only be returned if the provided element id belongs ====== .Query -[source, cypher, indent=0] // tag::functions_database_name_from_element_id[] +[source, cypher, indent=0] ---- WITH "2:efc7577d-022a-107c-a736-dbcdfc189c03:0" AS eid RETURN db.nameFromElementId(eid) AS name diff --git a/modules/ROOT/pages/functions/graph.adoc b/modules/ROOT/pages/functions/graph.adoc index 20b8a723f..c47db182e 100644 --- a/modules/ROOT/pages/functions/graph.adoc +++ b/modules/ROOT/pages/functions/graph.adoc @@ -24,8 +24,8 @@ CREATE ALIAS composite.third FOR DATABASE dbc; ---- .Query -[source, cypher, indent=0] // tag::functions_graph_names[] +[source, cypher, indent=0] ---- RETURN graph.names() AS name ---- @@ -71,8 +71,8 @@ CREATE ALIAS composite.third FOR DATABASE dbc ---- .Query -[source, cypher, indent=0] // tag::functions_graph_properties_by_name[] +[source, cypher, indent=0] ---- UNWIND graph.names() AS name RETURN name, graph.propertiesByName(name) AS props @@ -123,8 +123,8 @@ It is only supported in the xref:clauses/use.adoc[`USE` clause], on link:{neo4j- .Query [source, cypher, indent=0] -[source, cypher, role=noplay] // tag::functions_graph_by_name[] +[source, cypher, role=noplay] ---- UNWIND graph.names() AS graphName CALL { @@ -153,8 +153,8 @@ If the constituent database is not a standard database in the DBMS, an error wil In this example, it is assumed that the DBMS contains a composite database constituent, which contains the element id `4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0`. .Query -[source, cypher, role=test-skip] // tag::functions_graph_by_element_id[] +[source, cypher, role=test-skip] ---- USE graph.byElementId("4:c0a65d96-4993-4b0c-b036-e7ebd9174905:0") MATCH (n) RETURN n diff --git a/modules/ROOT/pages/functions/list.adoc b/modules/ROOT/pages/functions/list.adoc index ead46d7ba..ef49d7e3f 100644 --- a/modules/ROOT/pages/functions/list.adoc +++ b/modules/ROOT/pages/functions/list.adoc @@ -74,8 +74,8 @@ keys(expression) ====== .Query -[source, cypher] // tag::functions_list_keys[] +[source, cypher] ---- MATCH (a) WHERE a.name = 'Alice' RETURN keys(a) @@ -144,8 +144,8 @@ labels(node) ====== .Query -[source, cypher] // tag::functions_list_labels[] +[source, cypher] ---- MATCH (a) WHERE a.name = 'Alice' RETURN labels(a) @@ -211,8 +211,8 @@ nodes(path) ====== .Query -[source, cypher] // tag::functions_list_nodes[] +[source, cypher] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND c.name = 'Eskil' @@ -281,8 +281,8 @@ range(start, end [, step]) ====== .Query -[source, cypher] // tag::functions_list_range[] +[source, cypher] ---- RETURN range(0, 10), range(2, 18, 3), range(0, 5, -1) ---- @@ -353,8 +353,8 @@ reduce(accumulator = initial, variable IN list | expression) ====== .Query -[source, cypher] // tag::functions_list_reduce[] +[source, cypher] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND b.name = 'Bob' AND c.name = 'Daniel' @@ -421,8 +421,8 @@ relationships(path) ====== .Query -[source, cypher] // tag::functions_list_relationships[] +[source, cypher] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' AND c.name = 'Eskil' @@ -488,8 +488,8 @@ reverse(original) ====== .Query -[source, cypher] // tag::functions_list_reverse[] +[source, cypher] ---- WITH [4923,'abc',521, null, 487] AS ids RETURN reverse(ids) @@ -544,8 +544,8 @@ tail(list) ====== .Query -[source, cypher] // tag::functions_list_tail[] +[source, cypher] ---- MATCH (a) WHERE a.name = 'Eskil' RETURN a.array, tail(a.array) @@ -615,8 +615,8 @@ toBooleanList(list) ====== .Query -[source, cypher, indent=0] // tag::functions_list_to_boolean_list[] +[source, cypher, indent=0] ---- RETURN toBooleanList(null) as noList, toBooleanList([null, null]) as nullsInList, @@ -685,8 +685,8 @@ toFloatList(list) ====== .Query -[source, cypher] // tag::functions_list_to_float_list[] +[source, cypher] ---- RETURN toFloatList(null) as noList, toFloatList([null, null]) as nullsInList, @@ -755,8 +755,8 @@ toIntegerList(list) ====== .Query -[source, cypher] // tag::functions_list_to_integer_list[] +[source, cypher] ---- RETURN toIntegerList(null) as noList, toIntegerList([null, null]) as nullsInList, @@ -826,8 +826,8 @@ toStringList(list) ====== .Query -[source, cypher] // tag::functions_list_to_string_list[] +[source, cypher] ---- RETURN toStringList(null) as noList, toStringList([null, null]) as nullsInList, diff --git a/modules/ROOT/pages/functions/mathematical-logarithmic.adoc b/modules/ROOT/pages/functions/mathematical-logarithmic.adoc index 607c199a4..abdeab49d 100644 --- a/modules/ROOT/pages/functions/mathematical-logarithmic.adoc +++ b/modules/ROOT/pages/functions/mathematical-logarithmic.adoc @@ -31,8 +31,8 @@ e() ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_logarithmic_e[] +[source, cypher, indent=0] ---- RETURN e() ---- @@ -98,8 +98,8 @@ e(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_logarithmic_exp[] +[source, cypher, indent=0] ---- RETURN exp(2) ---- @@ -165,8 +165,8 @@ log(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_logarithmic_log[] +[source, cypher, indent=0] ---- RETURN log(27) ---- @@ -233,8 +233,8 @@ log10(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_logarithmic_log10[] +[source, cypher, indent=0] ---- RETURN log10(27) ---- @@ -300,8 +300,8 @@ sqrt(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_logarithmic_sqrt[] +[source, cypher, indent=0] ---- RETURN sqrt(256) ---- diff --git a/modules/ROOT/pages/functions/mathematical-numeric.adoc b/modules/ROOT/pages/functions/mathematical-numeric.adoc index b8d917e86..a5730bb7a 100644 --- a/modules/ROOT/pages/functions/mathematical-numeric.adoc +++ b/modules/ROOT/pages/functions/mathematical-numeric.adoc @@ -72,8 +72,8 @@ abs(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_abs[] +[source, cypher, indent=0] ---- MATCH (a), (e) WHERE a.name = 'Alice' AND e.name = 'Eskil' RETURN a.age, e.age, abs(a.age - e.age) ---- @@ -138,8 +138,8 @@ ceil(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_ceil[] +[source, cypher, indent=0] ---- RETURN ceil(0.1) ---- @@ -204,8 +204,8 @@ floor(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_floor[] +[source, cypher, indent=0] ---- RETURN floor(0.9) ---- @@ -268,8 +268,8 @@ isNaN(expression) ====== .Query -[source, cypher] // tag::functions_mathematical_numeric_is_nan[] +[source, cypher] ---- RETURN isNaN(0/0.0) ---- @@ -315,8 +315,8 @@ rand() ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_rand[] +[source, cypher, indent=0] ---- RETURN rand() ---- @@ -381,8 +381,8 @@ round(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_round[] +[source, cypher, indent=0] ---- RETURN round(3.141592) ---- @@ -467,8 +467,8 @@ round(expression, precision) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_round_with_precision[] +[source, cypher, indent=0] ---- RETURN round(3.141592, 3) ---- @@ -618,8 +618,8 @@ E.g. for precision 1, 2.15 is a tie as it has equal distance to 2.1 and 2.2, whi ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_round_with_precision_and_rounding_mode[] +[source, cypher, indent=0] ---- RETURN round(1.249, 1, 'UP') AS positive, round(-1.251, 1, 'UP') AS negative, @@ -841,8 +841,8 @@ sign(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_numeric_sign[] +[source, cypher, indent=0] ---- RETURN sign(-17), sign(0.1) ---- diff --git a/modules/ROOT/pages/functions/mathematical-trigonometric.adoc b/modules/ROOT/pages/functions/mathematical-trigonometric.adoc index 117a26574..db082bca2 100644 --- a/modules/ROOT/pages/functions/mathematical-trigonometric.adoc +++ b/modules/ROOT/pages/functions/mathematical-trigonometric.adoc @@ -49,8 +49,8 @@ acos(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_acos[] +[source, cypher, indent=0] ---- RETURN acos(0.5) ---- @@ -113,8 +113,8 @@ asin(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_asin[] +[source, cypher, indent=0] ---- RETURN asin(0.5) ---- @@ -177,8 +177,8 @@ atan(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_atan[] +[source, cypher, indent=0] ---- RETURN atan(0.5) ---- @@ -245,8 +245,8 @@ atan2(expression1, expression2) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_atan2[] +[source, cypher, indent=0] ---- RETURN atan2(0.5, 0.6) ---- @@ -311,8 +311,8 @@ cos(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_cos[] +[source, cypher, indent=0] ---- RETURN cos(0.5) ---- @@ -377,8 +377,8 @@ cot(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_cot[] +[source, cypher, indent=0] ---- RETURN cot(0.5) ---- @@ -442,8 +442,8 @@ degrees(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_degrees[] +[source, cypher, indent=0] ---- RETURN degrees(3.14159) ---- @@ -508,8 +508,8 @@ haversin(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_haversin[] +[source, cypher, indent=0] ---- RETURN haversin(0.5) ---- @@ -592,8 +592,8 @@ pi() ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_pi[] +[source, cypher, indent=0] ---- RETURN pi() ---- @@ -658,8 +658,8 @@ radians(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_radians[] +[source, cypher, indent=0] ---- RETURN radians(180) ---- @@ -723,8 +723,8 @@ sin(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_sin[] +[source, cypher, indent=0] ---- RETURN sin(0.5) ---- @@ -789,8 +789,8 @@ tan(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_mathematical_trigonometric_tan[] +[source, cypher, indent=0] ---- RETURN tan(0.5) ---- diff --git a/modules/ROOT/pages/functions/predicate.adoc b/modules/ROOT/pages/functions/predicate.adoc index c6d5ce90e..303600729 100644 --- a/modules/ROOT/pages/functions/predicate.adoc +++ b/modules/ROOT/pages/functions/predicate.adoc @@ -84,8 +84,8 @@ However, an implicit conversion will happen for single elements when passing nod ====== .Query -[source, cypher, indent=0] // tag::functions_predicate_all[] +[source, cypher, indent=0] ---- MATCH p = (a)-[*]->(b) WHERE @@ -160,8 +160,8 @@ However, an implicit conversion will happen for single elements when passing nod ====== .Query -[source, cypher, indent=0] // tag::functions_predicate_any[] +[source, cypher, indent=0] ---- MATCH (p:Person) WHERE any(nationality IN p.nationality WHERE nationality = 'American') @@ -229,8 +229,8 @@ exists(pattern) ====== .Query -[source, cypher, indent=0] // tag::functions_predicate_exists[] +[source, cypher, indent=0] ---- MATCH (p:Person) RETURN @@ -302,8 +302,8 @@ isEmpty(list) ====== .Query -[source, cypher] // tag::functions_predicate_is_empty[] +[source, cypher] ---- MATCH (p:Person) WHERE NOT isEmpty(p.nationality) @@ -482,8 +482,8 @@ However, an implicit conversion will happen for single elements when passing nod ====== .Query -[source, cypher, indent=0] // tag::functions_predicate_none[] +[source, cypher, indent=0] ---- MATCH p = (n)-[*]->(b) WHERE @@ -554,8 +554,8 @@ single(variable IN list WHERE predicate) ====== .Query -[source, cypher, indent=0] // tag::functions_predicate_single[] +[source, cypher, indent=0] ---- MATCH p = (n)-->(b) WHERE diff --git a/modules/ROOT/pages/functions/scalar.adoc b/modules/ROOT/pages/functions/scalar.adoc index 42477ea2f..f0e322584 100644 --- a/modules/ROOT/pages/functions/scalar.adoc +++ b/modules/ROOT/pages/functions/scalar.adoc @@ -80,8 +80,8 @@ char_length(string) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_char_length[] +[source, cypher, indent=0] ---- RETURN char_length('Alice') ---- @@ -146,8 +146,8 @@ character_length(string) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_character_length[] +[source, cypher, indent=0] ---- RETURN character_length('Alice') ---- @@ -211,8 +211,8 @@ coalesce(expression [, expression]*) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_coalesce[] +[source, cypher, indent=0] ---- MATCH (a) WHERE a.name = 'Alice' @@ -291,8 +291,8 @@ elementId(expression) ====== .Query -[source, cypher] // tag::functions_scalar_element_id[] +[source, cypher] ---- MATCH (n:Developer) RETURN elementId(n) @@ -378,8 +378,8 @@ endNode(relationship) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_end_node[] +[source, cypher, indent=0] ---- MATCH (x:Developer)-[r]-() RETURN endNode(r) @@ -443,8 +443,8 @@ head(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_head[] +[source, cypher, indent=0] ---- MATCH (a) WHERE a.name = 'Eskil' @@ -543,8 +543,8 @@ id(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_id[] +[source, cypher, indent=0] ---- MATCH (a) RETURN id(a) @@ -616,8 +616,8 @@ last(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_last[] +[source, cypher, indent=0] ---- MATCH (a) WHERE a.name = 'Eskil' @@ -684,8 +684,8 @@ length(path) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_length[] +[source, cypher, indent=0] ---- MATCH p = (a)-->(b)-->(c) WHERE a.name = 'Alice' @@ -772,8 +772,8 @@ The null value is returned as the two parameters are equivalent. ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_null_if[] +[source, cypher, indent=0] ---- RETURN nullIf("abc", "def") ---- @@ -868,8 +868,8 @@ properties(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_properties[] +[source, cypher, indent=0] ---- CREATE (p:Person {name: 'Stefan', city: 'Berlin'}) RETURN properties(p) @@ -918,8 +918,8 @@ randomUUID() ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_random_uuid[] +[source, cypher, indent=0] ---- RETURN randomUUID() AS uuid ---- @@ -981,8 +981,8 @@ size(list) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_size[] +[source, cypher, indent=0] ---- RETURN size(['Alice', 'Bob']) ---- @@ -1164,8 +1164,8 @@ startNode(relationship) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_start_node[] +[source, cypher, indent=0] ---- MATCH (x:Developer)-[r]-() RETURN startNode(r) @@ -1224,8 +1224,8 @@ timestamp() ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_timestamp[] +[source, cypher, indent=0] ---- RETURN timestamp() ---- @@ -1293,8 +1293,8 @@ toBoolean(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_to_boolean[] +[source, cypher, indent=0] ---- RETURN toBoolean('true'), toBoolean('not a boolean'), toBoolean(0) ---- @@ -1360,8 +1360,8 @@ toBooleanOrNull(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_to_boolean_or_null[] +[source, cypher, indent=0] ---- RETURN toBooleanOrNull('true'), toBooleanOrNull('not a boolean'), toBooleanOrNull(0), toBooleanOrNull(1.5) ---- @@ -1424,8 +1424,8 @@ toFloat(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_to_float[] +[source, cypher, indent=0] ---- RETURN toFloat('11.5'), toFloat('not a number') ---- @@ -1490,8 +1490,8 @@ toFloatOrNull(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_to_float_or_null[] +[source, cypher, indent=0] ---- RETURN toFloatOrNull('11.5'), toFloatOrNull('not a number'), toFloatOrNull(true) ---- @@ -1559,8 +1559,8 @@ toInteger(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_to_integer[] +[source, cypher, indent=0] ---- RETURN toInteger('42'), toInteger('not a number'), toInteger(true) ---- @@ -1626,8 +1626,8 @@ toIntegerOrNull(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_to_integer_or_null[] +[source, cypher, indent=0] ---- RETURN toIntegerOrNull('42'), toIntegerOrNull('not a number'), toIntegerOrNull(true), toIntegerOrNull(['A', 'B', 'C']) ---- @@ -1690,8 +1690,8 @@ type(relationship) ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_type[] +[source, cypher, indent=0] ---- MATCH (n)-[r]->() WHERE n.name = 'Alice' @@ -1792,8 +1792,8 @@ See the xref::values-and-types/type-predicate.adoc[type predicate expression] fo ====== .Query -[source, cypher, indent=0] // tag::functions_scalar_value_type[] +[source, cypher, indent=0] ---- UNWIND ["abc", 1, 2.0, true, [date()]] AS value RETURN valueType(value) AS result diff --git a/modules/ROOT/pages/functions/spatial.adoc b/modules/ROOT/pages/functions/spatial.adoc index eb54f64c9..108687942 100644 --- a/modules/ROOT/pages/functions/spatial.adoc +++ b/modules/ROOT/pages/functions/spatial.adoc @@ -129,8 +129,8 @@ The distance between two 3D points in the _WGS 84_ CRS is returned. ====== .Query -[source, cypher] // tag::functions_spatial_point_distance[] +[source, cypher] ---- MATCH (t:TrainStation)-[:TRAVEL_ROUTE]->(o:Office) WITH @@ -264,8 +264,8 @@ Checking if a point in _Cartesian_ CRS is contained in the bounding box. ====== .Query -[source, cypher] // tag::functions_spatial_point_within_bbox[] +[source, cypher] ---- WITH point({longitude: 12.53, latitude: 55.66}) AS lowerLeft, @@ -451,8 +451,8 @@ RETURN point({x: 2.3, y: 4.5, crs: 'WGS-84'}) AS point ====== .Query -[source, cypher] // tag::functions_spatial_point_wgs_84_2d[] +[source, cypher] ---- MATCH (p:Office) RETURN point({longitude: p.longitude, latitude: p.latitude}) AS officePoint @@ -558,8 +558,8 @@ point({longitude | x, latitude | y, height | z, [, crs][, srid]}) ====== .Query -[source, cypher] // tag::functions_spatial_point_wgs_84_3d[] +[source, cypher] ---- RETURN point({longitude: 56.7, latitude: 12.78, height: 8}) AS point ---- @@ -635,8 +635,8 @@ point({x, y [, crs][, srid]}) ====== .Query -[source, cypher] // tag::functions_spatial_point_cartesian_2d[] +[source, cypher] ---- RETURN point({x: 2.3, y: 4.5}) AS point ---- @@ -716,8 +716,8 @@ point({x, y, z, [, crs][, srid]}) ====== .Query -[source, cypher] // tag::functions_spatial_point_cartesian_3d[] +[source, cypher] ---- RETURN point({x: 2.3, y: 4.5, z: 2}) AS point ---- diff --git a/modules/ROOT/pages/functions/string.adoc b/modules/ROOT/pages/functions/string.adoc index 28e3627c3..91057e289 100644 --- a/modules/ROOT/pages/functions/string.adoc +++ b/modules/ROOT/pages/functions/string.adoc @@ -70,8 +70,8 @@ btrim(original [, trimCharacterString]) ====== .Query -[source, cypher, indent=0] // tag::functions_string_btrim[] +[source, cypher, indent=0] ---- RETURN btrim(' hello '), btrim('xxyyhelloxyxy', 'xy') ---- @@ -140,8 +140,8 @@ left(original, length) ====== .Query -[source, cypher, indent=0] // tag::functions_string_left[] +[source, cypher, indent=0] ---- RETURN left('hello', 3) ---- @@ -204,8 +204,8 @@ lower(original) ====== .Query -[source, cypher, indent=0] // tag::functions_string_lower[] +[source, cypher, indent=0] ---- RETURN lower('HELLO') ---- @@ -275,8 +275,8 @@ ltrim(original [, trimCharacterString]) ====== .Query -[source, cypher, indent=0] // tag::functions_string_ltrim[] +[source, cypher, indent=0] ---- RETURN ltrim(' hello'), ltrim('xxyyhelloxyxy', 'xy') ---- @@ -355,8 +355,8 @@ normalize(input) ====== .Query -[source, cypher, indent=0] // tag::functions_string_normalize[] +[source, cypher, indent=0] ---- RETURN normalize('\u212B') = '\u00C5' AS result ---- @@ -518,8 +518,8 @@ replace(original, search, replace) ====== .Query -[source, cypher, indent=0] // tag::functions_string_replace[] +[source, cypher, indent=0] ---- RETURN replace("hello", "l", "w") ---- @@ -582,8 +582,8 @@ reverse(original) ====== .Query -[source, cypher, indent=0] // tag::functions_string_reverse[] +[source, cypher, indent=0] ---- RETURN reverse('palindrome') ---- @@ -654,8 +654,8 @@ right(original, length) ====== .Query -[source, cypher, indent=0] // tag::functions_string_right[] +[source, cypher, indent=0] ---- RETURN right('hello', 3) ---- @@ -726,8 +726,8 @@ rtrim(original [, trimCharacterString]) ====== .Query -[source, cypher, indent=0] // tag::functions_string_rtrim[] +[source, cypher, indent=0] ---- RETURN rtrim('hello '), rtrim('xxyyhelloxyxy', 'xy') ---- @@ -793,8 +793,8 @@ split(original, splitDelimiter) ====== .Query -[source, cypher, indent=0] // tag::functions_string_split[] +[source, cypher, indent=0] ---- RETURN split('one,two', ',') ---- @@ -866,8 +866,8 @@ substring(original, start [, length]) ====== .Query -[source, cypher, indent=0] // tag::functions_string_substring[] +[source, cypher, indent=0] ---- RETURN substring('hello', 1, 3), substring('hello', 2) ---- @@ -929,8 +929,8 @@ toLower(original) ====== .Query -[source, cypher, indent=0] // tag::functions_string_to_lower[] +[source, cypher, indent=0] ---- RETURN toLower('HELLO') ---- @@ -993,8 +993,8 @@ toString(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_string_to_string[] +[source, cypher, indent=0] ---- RETURN toString(11.5), @@ -1061,8 +1061,8 @@ toStringOrNull(expression) ====== .Query -[source, cypher, indent=0] // tag::functions_string_to_string_or_null[] +[source, cypher, indent=0] ---- RETURN toStringOrNull(11.5), toStringOrNull('already a string'), @@ -1131,8 +1131,8 @@ toUpper(original) ====== .Query -[source, cypher, indent=0] // tag::functions_string_to_upper[] +[source, cypher, indent=0] ---- RETURN toUpper('hello') ---- @@ -1202,8 +1202,8 @@ trim([[LEADING | TRAILING | BOTH] [trimCharacterString] FROM] original) ====== .Query -[source, cypher, indent=0] // tag::functions_string_trim[] +[source, cypher, indent=0] ---- RETURN trim(' hello '), trim(BOTH 'x' FROM 'xxxhelloxxx') ---- @@ -1267,8 +1267,8 @@ upper(original) ====== .Query -[source, cypher, indent=0] // tag::functions_string_upper[] +[source, cypher, indent=0] ---- RETURN upper('hello') ---- diff --git a/modules/ROOT/pages/functions/temporal/duration.adoc b/modules/ROOT/pages/functions/temporal/duration.adoc index bf06b2f3b..3a6cb6611 100644 --- a/modules/ROOT/pages/functions/temporal/duration.adoc +++ b/modules/ROOT/pages/functions/temporal/duration.adoc @@ -66,8 +66,8 @@ The map of the `DURATION` components as numeric expressions. ====== .Query -[source, cypher, indent=0] // tag::functions_duration[] +[source, cypher, indent=0] ---- UNWIND [ duration({days: 14, hours:16, minutes: 12}), @@ -143,8 +143,8 @@ duration(temporalAmount) ====== .Query -[source, cypher, indent=0] // tag::functions_duration_from_string[] +[source, cypher, indent=0] ---- UNWIND [ duration("P14DT16H12M"), @@ -235,8 +235,8 @@ duration.between(instant1, instant2) ====== .Query -[source, cypher, indent=0] // tag::functions_duration_between[] +[source, cypher, indent=0] ---- UNWIND [ duration.between(date("1984-10-11"), date("1985-11-25")), @@ -322,8 +322,8 @@ For more information, see xref:values-and-types/temporal.adoc#cypher-temporal-ac ====== .Query -[source, cypher, indent=0] // tag::functions_duration_in_months[] +[source, cypher, indent=0] ---- UNWIND [ duration.inMonths(date("1984-10-11"), date("1985-11-25")), @@ -408,8 +408,8 @@ For more information, see xref:values-and-types/temporal.adoc#cypher-temporal-ac ====== .Query -[source, cypher, indent=0] // tag::functions_duration_in_days[] +[source, cypher, indent=0] ---- UNWIND [ duration.inDays(date("1984-10-11"), date("1985-11-25")), @@ -492,8 +492,8 @@ For more information, see xref:values-and-types/temporal.adoc#cypher-temporal-ac ====== .Query -[source, cypher, indent=0] // tag::functions_duration_in_seconds[] +[source, cypher, indent=0] ---- UNWIND [ duration.inSeconds(date("1984-10-11"), date("1984-10-12")), diff --git a/modules/ROOT/pages/functions/temporal/index.adoc b/modules/ROOT/pages/functions/temporal/index.adoc index 49d00151a..addb4ecd8 100644 --- a/modules/ROOT/pages/functions/temporal/index.adoc +++ b/modules/ROOT/pages/functions/temporal/index.adoc @@ -366,8 +366,8 @@ date([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_date[] +[source, cypher] ---- RETURN date() AS currentDate ---- @@ -450,8 +450,8 @@ date.transaction([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_date_transaction[] +[source, cypher] ---- RETURN date.transaction() AS currentDate ---- @@ -509,8 +509,8 @@ date.statement([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_date_statement[] +[source, cypher] ---- RETURN date.statement() AS currentDate ---- @@ -567,8 +567,8 @@ date.realtime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_date_realtime[] +[source, cypher] ---- RETURN date.realtime() AS currentDate ---- @@ -1265,8 +1265,8 @@ datetime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_datetime[] +[source, cypher] ---- RETURN datetime() AS currentDateTime ---- @@ -1350,8 +1350,8 @@ datetime.transaction([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_datetime_transaction[] +[source, cypher] ---- RETURN datetime.transaction() AS currentDateTime ---- @@ -1430,8 +1430,8 @@ datetime.statement([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_datetime_statement[] +[source, cypher] ---- RETURN datetime.statement() AS currentDateTime ---- @@ -1488,8 +1488,8 @@ datetime.realtime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_datetime_realtime[] +[source, cypher] ---- RETURN datetime.realtime() AS currentDateTime ---- @@ -2524,8 +2524,8 @@ localdatetime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localdatetime[] +[source, cypher] ---- RETURN localdatetime() AS now ---- @@ -2609,8 +2609,8 @@ localdatetime.transaction([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localdatetime_transaction[] +[source, cypher] ---- RETURN localdatetime.transaction() AS now ---- @@ -2668,8 +2668,8 @@ localdatetime.statement([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localdatetime_statement[] +[source, cypher] ---- RETURN localdatetime.statement() AS now ---- @@ -2726,8 +2726,8 @@ localdatetime.realtime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localdatetime_realtime[] +[source, cypher] ---- RETURN localdatetime.realtime() AS now ---- @@ -3608,8 +3608,8 @@ localtime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localtime[] +[source, cypher] ---- RETURN localtime() AS now ---- @@ -3693,8 +3693,8 @@ localtime.transaction([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localtime_transaction[] +[source, cypher] ---- RETURN localtime.transaction() AS now ---- @@ -3752,8 +3752,8 @@ localtime.statement([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localtime_statement[] +[source, cypher] ---- RETURN localtime.statement() AS now ---- @@ -3832,8 +3832,8 @@ localtime.realtime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_localtime_realtime[] +[source, cypher] ---- RETURN localtime.realtime() AS now ---- @@ -4260,8 +4260,8 @@ time([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_time[] +[source, cypher] ---- RETURN time() AS currentTime ---- @@ -4344,8 +4344,8 @@ time.transaction([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_time_transaction[] +[source, cypher] ---- RETURN time.transaction() AS currentTime ---- @@ -4400,8 +4400,8 @@ time.statement([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_time_statement[] +[source, cypher] ---- RETURN time.statement() AS currentTime ---- @@ -4480,8 +4480,8 @@ time.realtime([{timezone}]) ====== .Query -[source, cypher] // tag::functions_temporal_time_realtime[] +[source, cypher] ---- RETURN time.realtime() AS currentTime ---- From e324872a471a19d812edbe55f2147cf6ee1a955f Mon Sep 17 00:00:00 2001 From: Richard Sill Date: Wed, 21 Aug 2024 14:19:18 +0200 Subject: [PATCH 21/22] added test changes for reverse('palindrome') --- modules/ROOT/pages/functions/string.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/pages/functions/string.adoc b/modules/ROOT/pages/functions/string.adoc index 91057e289..7adf87461 100644 --- a/modules/ROOT/pages/functions/string.adoc +++ b/modules/ROOT/pages/functions/string.adoc @@ -593,8 +593,8 @@ RETURN reverse('palindrome') [role="queryresult",options="header,footer",cols="1* Date: Tue, 10 Sep 2024 14:35:56 +0200 Subject: [PATCH 22/22] add back lost query tags --- modules/ROOT/pages/functions/temporal/index.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/ROOT/pages/functions/temporal/index.adoc b/modules/ROOT/pages/functions/temporal/index.adoc index 0e589a4be..3354a69a4 100644 --- a/modules/ROOT/pages/functions/temporal/index.adoc +++ b/modules/ROOT/pages/functions/temporal/index.adoc @@ -1394,10 +1394,12 @@ The returned `ZONED DATETIME` will be the live clock of the system. ====== .Query +// tag::functions_temporal_datetime_realtime[] [source, cypher] ---- RETURN datetime.realtime() AS currentDateTime ---- +// end::functions_temporal_datetime_realtime[] .Result [role="queryresult",options="header,footer",cols="1*