Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
73daebe
tags for the first aggregating function (avg)
rsill-neo4j Jul 9, 2024
807e331
more tags for aggregate functions
rsill-neo4j Jul 9, 2024
a1a6ab7
database function tag
rsill-neo4j Jul 9, 2024
0bf1d0d
duration tags
rsill-neo4j Jul 10, 2024
0d43d2f
duration include statement(s)
rsill-neo4j Jul 12, 2024
360a122
tags for graph functions
rsill-neo4j Jul 15, 2024
a3245b9
tags for list functions
rsill-neo4j Jul 15, 2024
9bbd41d
Merge branch 'dev' into include-statements-for-functions-section
rsill-neo4j Jul 15, 2024
4068a57
tags for numerical math functions
rsill-neo4j Jul 15, 2024
28e8af7
tags for logarithmic math functions
rsill-neo4j Jul 15, 2024
f66d1f5
tags for trigonometric math functions
rsill-neo4j Jul 15, 2024
b4fac40
predicate function tags
rsill-neo4j Jul 15, 2024
de32536
tags for scalar functions
rsill-neo4j Jul 16, 2024
23c0033
tags for string functions
rsill-neo4j Jul 16, 2024
470fdd8
added tags for spatial functions
rsill-neo4j Jul 16, 2024
d0c846b
closing tag
rsill-neo4j Jul 16, 2024
c32e68d
tags for temporal functions
rsill-neo4j Jul 16, 2024
80cbb45
Merge branch 'dev' into include-statements-for-functions-section
rsill-neo4j Jul 19, 2024
e4c9053
added two tags, modified another, to test tag scope
rsill-neo4j Aug 19, 2024
28021c6
added tags according to suggestions in the cheat sheet PR
rsill-neo4j Aug 20, 2024
4c11afa
some added tags and a wording update
rsill-neo4j Aug 20, 2024
aad7d34
placed tags outside of [source, cypher] scope
rsill-neo4j Aug 21, 2024
e324872
added test changes for reverse('palindrome')
rsill-neo4j Aug 21, 2024
1c5e35d
Merge branch 'dev' into include-statements-for-functions-section
rsill-neo4j Aug 26, 2024
0ea2d07
Merge branch 'dev' into include-statements-for-functions-section
JPryce-Aklundh Sep 10, 2024
94f65f7
add back lost query tags
JPryce-Aklundh Sep 10, 2024
90fdcce
Merge branch 'dev' into include-statements-for-functions-section
rsill-neo4j Oct 31, 2024
059930e
Merge branch 'dev' into include-statements-for-functions-section
JPryce-Aklundh Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions modules/ROOT/pages/functions/aggregating.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ CREATE
======

.Query
// tag::functions_aggregating_avg[]
[source, cypher]
----
MATCH (p:Person)
RETURN avg(p.age)
----
// end::functions_aggregating_avg[]

The average of all the values in the property `age` is returned:

Expand All @@ -87,11 +89,13 @@ The average of all the values in the property `age` is returned:
======

.Query
// tag::functions_aggregating_duration_avg[]
[source, cypher]
----
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:

Expand Down Expand Up @@ -133,11 +137,13 @@ The average of the two supplied `DURATION` values is returned:
======

.Query
// tag::functions_aggregating_collect[]
[source, cypher]
----
MATCH (p:Person)
RETURN collect(p.age)
----
// end::functions_aggregating_collect[]

All the values are collected and returned in a single list:

Expand Down Expand Up @@ -189,11 +195,13 @@ The function `count(*)` can be used to return the number of nodes; for example,
======

.Query
// tag::functions_aggregating_count[]
[source, cypher]
----
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:

Expand Down Expand Up @@ -248,11 +256,13 @@ Instead of simply returning the number of rows with `count(*)`, the function `co
======

.Query
// tag::functions_aggregating_count_as_expression[]
[source, cypher]
----
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)`)
Expand Down Expand Up @@ -389,11 +399,13 @@ The highest of all the lists in the set -- in this case, the list `[1, 2]` -- is
======

.Query
// tag::functions_aggregating_max[]
[source, cypher]
----
MATCH (p:Person)
RETURN max(p.age)
----
// end::functions_aggregating_max[]

The highest of all the values in the property `age` is returned:

Expand Down Expand Up @@ -486,11 +498,13 @@ The lowest of all the values in the set -- in this case, the list `['a', 'c', 23
======

.Query
// tag::functions_aggregating_min[]
[source, cypher]
----
MATCH (p:Person)
RETURN min(p.age)
----
// end::functions_aggregating_min[]

The lowest of all the values in the property `age` is returned:

Expand Down Expand Up @@ -532,11 +546,13 @@ The lowest of all the values in the property `age` is returned:
======

.Query
// tag::functions_aggregating_percentile_cont[]
[source, cypher]
----
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:

Expand Down Expand Up @@ -579,11 +595,13 @@ The 40th percentile of the values in the property `age` is returned, calculated
======

.Query
// tag::functions_aggregating_percentile_disc[]
[source, cypher]
----
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:

Expand Down Expand Up @@ -625,12 +643,14 @@ The 50th percentile of the values in the property `age` is returned:
======

.Query
// tag::functions_aggregating_stdev[]
[source, cypher]
----
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:

Expand Down Expand Up @@ -672,12 +692,14 @@ The standard deviation of the values in the property `age` is returned:
======

.Query
// tag::functions_aggregating_stdevp[]
[source, cypher]
----
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:

Expand Down Expand Up @@ -719,11 +741,13 @@ The population standard deviation of the values in the property `age` is returne
======

.Query
// tag::functions_aggregating_sum[]
[source, cypher]
----
MATCH (p:Person)
RETURN sum(p.age)
----
// end::functions_aggregating_sum[]

The sum of all the values in the property `age` is returned:

Expand All @@ -744,11 +768,13 @@ The sum of all the values in the property `age` is returned:
======

.Query
// tag::functions_aggregating_sum_duration[]
[source, cypher]
----
UNWIND [duration('P2DT3H'), duration('PT1H45S')] AS dur
RETURN sum(dur)
----
// end::functions_aggregating_sum_duration[]

The sum of the two supplied durations is returned:

Expand Down
2 changes: 2 additions & 0 deletions modules/ROOT/pages/functions/database.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
======

.Query
// 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
----
// end::functions_database_name_from_element_id[]

Returns the name of the database which the element id belongs to.

Expand Down
10 changes: 9 additions & 1 deletion modules/ROOT/pages/functions/graph.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ CREATE ALIAS composite.third FOR DATABASE dbc;
----

.Query
// tag::functions_graph_names[]
[source, cypher, indent=0]
----
RETURN graph.names() AS name
----
// end::functions_graph_names[]

The names of all graphs on the current composite database are returned.

Expand Down Expand Up @@ -91,11 +93,13 @@ CREATE ALIAS composite.third FOR DATABASE dbc
----

.Query
// tag::functions_graph_properties_by_name[]
[source, cypher, indent=0]
----
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.

Expand Down Expand Up @@ -150,7 +154,8 @@ For more information, see xref:subqueries/call-subquery.adoc#import-variables[CA
======

.Query
[source, cypher, indent=0]
// tag::functions_graph_by_name[]
[source, cypher, role=noplay]
----
UNWIND graph.names() AS graphName
CALL () {
Expand All @@ -160,6 +165,7 @@ CALL () {
}
RETURN n
----
// end::functions_graph_by_name[]

Returns all nodes from all graphs on the current composite database.

Expand Down Expand Up @@ -194,10 +200,12 @@ For more information, see xref:subqueries/call-subquery.adoc#import-variables[CA
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
// 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
----
// end::functions_graph_by_element_id[]

======
Loading
Loading