Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 59 additions & 0 deletions modules/ROOT/pages/extending-neo4j/aggregation-functions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ An aggregator class contains one method annotated with `@UserAggregationUpdate`
The method annotated with `@UserAggregationUpdate` will be called multiple times and enables the class to aggregate data.
When the aggregation is done, the method annotated with `@UserAggregationResult` will be called once and the result of the aggregation will be returned.

Particular things to note:

* All functions are annotated with `@UserAggregationFunction`.
* The aggregation function name must be namespaced and is not allowed in reserved namespaces.
* If a user-defined aggregation function is registered with the same name as a built-in function in a deprecated namespace, the built-in function is shadowed.


See xref:extending-neo4j/values-and-types.adoc[] for details on values and types.

For more details, see the Neo4j Javadocs for link:{org-neo4j-procedure-UserAggregationFunction}[`org.neo4j.procedure.UserAggregationFunction`^].
Expand Down Expand Up @@ -132,3 +139,55 @@ public class LongestStringTest
}
----

[[reserved-and-deprecated-namespaces]]
== Reserved and deprecated function namespaces

[[reserved-and-deprecated-function-namespaces]]
.Overview of reserved and deprecated function namespaces and names
[options="header", cols="m,m"]
|===
| Reserved | Deprecated since Neo4j 2025.11
| * | abac.*
| date | aura.*
| date.realtime | builtin.*
| date.statement | cdc.*
| date.transaction | coll.*
| date.truncate | date.*
| datetime | datetime.*
| datetime.fromepoch | db.*
| datetime.fromepochmillis | dbms.*
| datetime.realtime | duration.*
| datetime.statement | graph.*
| datetime.transaction | internal.*
| datetime.truncate | localdatetime.*
| db.nameFromElementId | localtime.*
| duration | math.*
| duration.between | plugin.*
| duration.inDays | point.*
| duration.inMonths | stored.*
| duration.inSeconds | string.*
| graph.byElementId | time.*
| graph.byName | tx.*
| graph.names | unsupported.*
| graph.propertiesByName | vector.*
| localdatetime |
| localdatetime.realtime |
| localdatetime.statement |
| localdatetime.transaction |
| localdatetime.truncate |
| localtime |
| localtime.realtime |
| localtime.statement |
| localtime.transaction |
| localtime.truncate |
| point.distance |
| point.withinBBox |
| time |
| time.realtime |
| time.statement |
| time.transaction |
| time.truncate |
| vector.similarity.cosine |
| vector.similarity.euclidean |
|===

57 changes: 57 additions & 0 deletions modules/ROOT/pages/extending-neo4j/functions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ RETURN org.neo4j.examples.join(collect(p.names))
User-defined functions are created similarly to how procedures are created.
But unlike procedures, they are annotated with `@UserFunction` and return a single value instead of a stream of values.

Particular things to note:

* All functions are annotated with `@UserFunction`.
* The function name must be namespaced and is not allowed in reserved namespaces.
* If a function is registered with the same name as a built-in function in a deprecated namespace, the built-in function is shadowed.

See xref:extending-neo4j/values-and-types.adoc[] for details on values and types.

For more details, see the link:{org-neo4j-procedure-UserFunction}[Neo4j Javadocs for `org.neo4j.procedure.UserFunction`^].
Expand Down Expand Up @@ -120,3 +126,54 @@ public class JoinTest {
}
----

[[reserved-and-deprecated-namespaces]]
== Reserved and deprecated function namespaces

[[reserved-and-deprecated-function-namespaces]]
.Overview of reserved and deprecated function namespaces and names
[options="header", cols="m,m"]
|===
| Reserved | Deprecated since Neo4j 2025.11
| * | abac.*
| date | aura.*
| date.realtime | builtin.*
| date.statement | cdc.*
| date.transaction | coll.*
| date.truncate | date.*
| datetime | datetime.*
| datetime.fromepoch | db.*
| datetime.fromepochmillis | dbms.*
| datetime.realtime | duration.*
| datetime.statement | graph.*
| datetime.transaction | internal.*
| datetime.truncate | localdatetime.*
| db.nameFromElementId | localtime.*
| duration | math.*
| duration.between | plugin.*
| duration.inDays | point.*
| duration.inMonths | stored.*
| duration.inSeconds | string.*
| graph.byElementId | time.*
| graph.byName | tx.*
| graph.names | unsupported.*
| graph.propertiesByName | vector.*
| localdatetime |
| localdatetime.realtime |
| localdatetime.statement |
| localdatetime.transaction |
| localdatetime.truncate |
| localtime |
| localtime.realtime |
| localtime.statement |
| localtime.transaction |
| localtime.truncate |
| point.distance |
| point.withinBBox |
| time |
| time.realtime |
| time.statement |
| time.transaction |
| time.truncate |
| vector.similarity.cosine |
| vector.similarity.euclidean |
|===
27 changes: 26 additions & 1 deletion modules/ROOT/pages/extending-neo4j/procedures.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Particular things to note:
* The procedure annotation can take three optional arguments: `name`, `mode`, and `eager`.
** `name` is used to specify a different name for the procedure than the default generated, which is `class.path.nameOfMethod`.
If `mode` is specified, `name` must be specified as well.
** `name` is not allowed in a reserved namespace, and having a `name` without a namespace is deprecated behavior.
** If a procedure is registered with the same name as a built-in procedure in a deprecated namespace, the built-in procedure is shadowed.
** `mode` is used to declare the types of interactions that the procedure performs.
A procedure fails if it attempts to execute database operations that violate its mode.
The default `mode` is `READ`.
Expand All @@ -163,7 +165,7 @@ Particular things to note:
MATCH (n)
WHERE n.key = 'value'
WITH n
CALL deleteNeighbours(n, 'FOLLOWS')
CALL example.deleteNeighbours(n, 'FOLLOWS')
----
This query can delete some of the nodes that are matched by the Cypher query, and the `n.key` lookup will fail.
Marking this procedure as `eager` prevents this from causing an error in Cypher code.
Expand Down Expand Up @@ -273,3 +275,26 @@ public class MyProcedures {
}

----

[[reserved-and-deprecated-namespaces]]
== Reserved and deprecated procedure namespaces

[[reserved-and-deprecated-procedure-namespaces]]
.Overview of reserved and deprecated procedure namespaces
[options="header", cols="m,m"]
|===
| Reserved | Deprecated since Neo4j 2025.11
| cdc.* | *
| date.* | abac.*
| datetime.* | aura.*
| db.* | builtin.*
| dbms.* | coll.*
| duration.* | math.*
| graph.* | plugin.*
| internal.* | point.*
| localdatetime.* | stored.*
| localtime.* | string.*
| time.* | vector.*
| tx.* |
| unsupported.* |
|===