Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
58 changes: 58 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 is required to be namespaced and is not allowed in one of the 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 will be 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,54 @@ 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
| date |abac.*
| date.realtime |aura.*
| date.statement |builtin.*
| date.transaction |cdc.*
| date.truncate |coll.*
| datetime |date.*
| datetime.fromepoch |datetime.*
| datetime.fromepochmillis |db.*
| datetime.realtime |dbms.*
| datetime.statement |duration.*
| datetime.transaction |graph.*
| datetime.truncate |internal.*
| db.nameFromElementId |localdatetime.*
| duration |localtime.*
| duration.between |math.*
| duration.inDays |plugin.*
| duration.inMonths |point.*
| duration.inSeconds |stored.*
| graph.byElementId |string.*
| graph.byName |time.*
| graph.names |tx.*
| graph.propertiesByName |unsupported.*
| localdatetime |vector.*
| 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 |
|===

38 changes: 38 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 is required to be namespaced and is not allowed in one of the reserved namespaces.
* If a function is registered with the same name as a built-in function in a deprecated namespace the built-in function will be 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,35 @@ 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
| cdc.* | abac.*
| date.* | aura.*
| datetime.* | builtin.*
| db.* | coll.*
| dbms.* | math.*
| duration.* | plugin.*
| graph.* | point.*
| internal.* | stored.*
| localdatetime.* | string.*
| localtime.* | vector.*
| time.* |
| tx.* |
| unsupported.* |
|===










54 changes: 53 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 required to be namespaced and is not allowed in one of the reserved namespaces.
** If a procedure is registered with the same name as a built-in procedure in a deprecated namespace the built-in procedure will be 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,53 @@ public class MyProcedures {
}

----
[[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
| date |abac.*
| date.realtime |aura.*
| date.statement |builtin.*
| date.transaction |cdc.*
| date.truncate |coll.*
| datetime |date.*
| datetime.fromepoch |datetime.*
| datetime.fromepochmillis |db.*
| datetime.realtime |dbms.*
| datetime.statement |duration.*
| datetime.transaction |graph.*
| datetime.truncate |internal.*
| db.nameFromElementId |localdatetime.*
| duration |localtime.*
| duration.between |math.*
| duration.inDays |plugin.*
| duration.inMonths |point.*
| duration.inSeconds |stored.*
| graph.byElementId |string.*
| graph.byName |time.*
| graph.names |tx.*
| graph.propertiesByName |unsupported.*
| localdatetime |vector.*
| 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 |
|===