Skip to content

Commit fce6286

Browse files
committed
[lYfZxdRz] Migrate procedures and functions docs from Core to Cypher 25
1 parent eb31c8d commit fce6286

16 files changed

+730
-1
lines changed

docs/asciidoc/modules/ROOT/pages/deprecations-and-additions/index.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@
44

55
This chapter lists all the features that have been removed, deprecated, added or extended in the recent versions of APOC.
66

7+
[[apoc-deprecations-additions-removals-2025.01]]
8+
== Version 2025.01
9+
10+
=== New procedures and functions
11+
12+
[cols="2", options="header"]
13+
|===
14+
| Feature
15+
| Details
16+
17+
a|
18+
label:procedure[]
19+
label:new[]
20+
[source, cypher, role="noheader"]
21+
----
22+
apoc.export.arrow.all(file [, config ])
23+
apoc.export.arrow.graph(file, graph [, config ])
24+
apoc.export.arrow.query(file, query [, config ])
25+
apoc.export.arrow.stream.all([ config ])
26+
apoc.export.arrow.stream.graph(graph [, config ])
27+
apoc.export.arrow.stream.query(query [, config ])
28+
apoc.load.arrow(file [, config ])
29+
apoc.load.arrow.stream(source [, config ])
30+
apoc.load.jsonParams(urlOrKeyOrBinary, headers, payload [, path, config ])
31+
apoc.log.stream(path [, config ])
32+
----
33+
a|
34+
All of these procedures were migrated from Cypher Core.
35+
36+
|===
37+
738
[[apoc-deprecations-additions-removals-5.0]]
839
== Version 5.0
940

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
:page-role: procedure
2+
:table-caption!:
3+
= apoc.export.arrow.all
4+
5+
[NOTE]
6+
====
7+
This procedure is not considered safe to run from multiple threads.
8+
It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13).
9+
For more information, see the link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/planning-and-tuning/runtimes/concepts#runtimes-parallel-runtime[Cypher Manual -> Parallel runtime].
10+
====
11+
12+
.Details
13+
|===
14+
| *Syntax* 3+| `apoc.export.arrow.all(file [, config ]) :: (file, source, format, nodes, relationships, properties, time, rows, batchSize, batches, done, data)`
15+
| *Description* 3+| Exports the full database as an arrow file.
16+
.3+| *Input arguments* | *Name* | *Type* | *Description*
17+
| `file` | `STRING` | The name of the file to export the data to.
18+
| `config` | `MAP` | `{ batchSize = 2000 :: INTEGER }`. The default is: `{}`.
19+
.13+| *Return arguments* | *Name* | *Type* | *Description*
20+
| `file` | `STRING` | The name of the file to which the data was exported.
21+
| `source` | `STRING` | A summary of the exported data.
22+
| `format` | `STRING` | The format the file is exported in.
23+
| `nodes` | `INTEGER` | The number of exported nodes.
24+
| `relationships` | `INTEGER` | The number of exported relationships.
25+
| `properties` | `INTEGER` | The number of exported properties.
26+
| `time` | `INTEGER` | The duration of the export.
27+
| `rows` | `INTEGER` | The number of rows returned.
28+
| `batchSize` | `INTEGER` | The size of the batches the export was run in.
29+
| `batches` | `INTEGER` | The number of batches the export was run in.
30+
| `done` | `BOOLEAN` | Whether the export ran successfully.
31+
| `data` | `ANY` | The data returned by the export.
32+
|===
33+
34+
== Usage Examples
35+
The procedure expose an Arrow file with the following structure
36+
- `<id>`: for node id
37+
- `<labels>`: list of labels
38+
- `<source.id>`: source node id (in case of relationship)
39+
- `<target.id>`: target node id (in case of relationship)
40+
- `<type>`: for relationship type
41+
- the list of properties of nodes and relationships flattened as table
42+
43+
So for the following query:
44+
45+
[source,cypher]
46+
----
47+
CREATE (f:User {name:'Adam',age:42,male:true,kids:['Sam','Anna','Grace'], born:localdatetime('2015185T19:32:24'), place:point({latitude: 13.1, longitude: 33.46789})})-[:KNOWS {since: 1993, bffSince: duration('P5M1.5D')}]->(b:User {name:'Jim',age:42}),(c:User {age:12}),(d:Another {foo: 'bar'})
48+
----
49+
50+
With this query:
51+
52+
[source,cypher]
53+
----
54+
CALL apoc.export.arrow.all('my_file.arrow') YIELD file, source, format,
55+
nodes, relationships, properties,
56+
time, rows, batchSize,
57+
batches, done, data
58+
----
59+
60+
We'll have an arrow file with the following columns:
61+
62+
- `<id>`
63+
- `<labels>`
64+
- `<source.id>`
65+
- `<target.id>`
66+
- `<type>`
67+
- `name`
68+
- `age`
69+
- `male`
70+
- `kids`
71+
- `born`
72+
- `place`
73+
- `since`
74+
- `bffSince`
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
:page-role: procedure
2+
:table-caption!:
3+
= apoc.export.arrow.graph
4+
5+
[NOTE]
6+
====
7+
This procedure is not considered safe to run from multiple threads.
8+
It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13).
9+
For more information, see the link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/planning-and-tuning/runtimes/concepts#runtimes-parallel-runtime[Cypher Manual -> Parallel runtime].
10+
====
11+
12+
.Details
13+
|===
14+
| *Syntax* 3+| `apoc.export.arrow.graph(file, graph [, config ]) :: (file, source, format, nodes, relationships, properties, time, rows, batchSize, batches, done, data)`
15+
| *Description* 3+| Exports the given graph as an arrow file.
16+
.4+| *Input arguments* | *Name* | *Type* | *Description*
17+
| `file` | `STRING` | The name of the file to export the data to.
18+
| `graph` | `ANY` | The graph to export.
19+
| `config` | `MAP` | `{ batchSize = 2000 :: INTEGER }`. The default is: `{}`.
20+
.13+| *Return arguments* | *Name* | *Type* | *Description*
21+
| `file` | `STRING` | The name of the file to which the data was exported.
22+
| `source` | `STRING` | A summary of the exported data.
23+
| `format` | `STRING` | The format the file is exported in.
24+
| `nodes` | `INTEGER` | The number of exported nodes.
25+
| `relationships` | `INTEGER` | The number of exported relationships.
26+
| `properties` | `INTEGER` | The number of exported properties.
27+
| `time` | `INTEGER` | The duration of the export.
28+
| `rows` | `INTEGER` | The number of rows returned.
29+
| `batchSize` | `INTEGER` | The size of the batches the export was run in.
30+
| `batches` | `INTEGER` | The number of batches the export was run in.
31+
| `done` | `BOOLEAN` | Whether the export ran successfully.
32+
| `data` | `ANY` | The data returned by the export.
33+
|===
34+
35+
== Usage Examples
36+
The procedure expose an Arrow file of rows with the following structure
37+
- `<id>`: for node id
38+
- `<labels>`: list of labels
39+
- `<source.id>`: source node id (in case of relationship)
40+
- `<target.id>`: target node id (in case of relationship)
41+
- `<type>`: for relationship type
42+
- the list of properties of nodes and relationships flattened as table
43+
44+
So for the following query:
45+
46+
[source,cypher]
47+
----
48+
CREATE (f:User {name:'Adam',age:42,male:true,kids:['Sam','Anna','Grace'], born:localdatetime('2015185T19:32:24'), place:point({latitude: 13.1, longitude: 33.46789})})-[:KNOWS {since: 1993, bffSince: duration('P5M1.5D')}]->(b:User {name:'Jim',age:42}),(c:User {age:12}),(d:Another {foo: 'bar'})
49+
----
50+
51+
With this query:
52+
53+
[source,cypher]
54+
----
55+
CALL apoc.graph.fromDB('neo4j',{}) yield graph
56+
CALL apoc.export.arrow.graph('my_file.arrow', graph) YIELD file, source, format,
57+
nodes, relationships, properties,
58+
time, rows, batchSize,
59+
batches, done, data
60+
----
61+
62+
We'll have an arrow file with the following columns:
63+
64+
- `<id>`
65+
- `<labels>`
66+
- `<source.id>`
67+
- `<target.id>`
68+
- `<type>`
69+
- `name`
70+
- `age`
71+
- `male`
72+
- `kids`
73+
- `born`
74+
- `place`
75+
- `since`
76+
- `bffSince`
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
:page-role: procedure
2+
:table-caption!:
3+
= apoc.export.arrow.query
4+
5+
[NOTE]
6+
====
7+
This procedure is not considered safe to run from multiple threads.
8+
It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13).
9+
For more information, see the link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/planning-and-tuning/runtimes/concepts#runtimes-parallel-runtime[Cypher Manual -> Parallel runtime].
10+
====
11+
12+
.Details
13+
|===
14+
| *Syntax* 3+| `apoc.export.arrow.query(file, query [, config ]) :: (file, source, format, nodes, relationships, properties, time, rows, batchSize, batches, done, data)`
15+
| *Description* 3+| Exports the results from the given Cypher query as an arrow file.
16+
.4+| *Input arguments* | *Name* | *Type* | *Description*
17+
| `file` | `STRING` | The name of the file to which the data will be exported.
18+
| `query` | `STRING` | The query to use to collect the data for export.
19+
| `config` | `MAP` | `{ batchSize = 2000 :: INTEGER }`. The default is: `{}`.
20+
.13+| *Return arguments* | *Name* | *Type* | *Description*
21+
| `file` | `STRING` | The name of the file to which the data was exported.
22+
| `source` | `STRING` | A summary of the exported data.
23+
| `format` | `STRING` | The format the file is exported in.
24+
| `nodes` | `INTEGER` | The number of exported nodes.
25+
| `relationships` | `INTEGER` | The number of exported relationships.
26+
| `properties` | `INTEGER` | The number of exported properties.
27+
| `time` | `INTEGER` | The duration of the export.
28+
| `rows` | `INTEGER` | The number of rows returned.
29+
| `batchSize` | `INTEGER` | The size of the batches the export was run in.
30+
| `batches` | `INTEGER` | The number of batches the export was run in.
31+
| `done` | `BOOLEAN` | Whether the export ran successfully.
32+
| `data` | `ANY` | The data returned by the export.
33+
|===
34+
35+
== Usage Examples
36+
Let's suppose we have this data set:
37+
38+
[source,cypher]
39+
----
40+
CREATE (f:User {name:'Adam',age:42,male:true,kids:['Sam','Anna','Grace'], born:localdatetime('2015185T19:32:24'), place:point({latitude: 13.1, longitude: 33.46789})})-[:KNOWS {since: 1993, bffSince: duration('P5M1.5D')}]->(b:User {name:'Jim',age:42}),(c:User {name: 'John', age:12}),(d:Another {foo: 'bar'})
41+
----
42+
43+
With this query:
44+
45+
[source,cypher]
46+
----
47+
CALL apoc.export.arrow.query('my_file.arrow', 'MATCH (n:User) RETURN count(n) as count, n.name as name') YIELD file, source, format,
48+
nodes, relationships, properties,
49+
time, rows, batchSize,
50+
batches, done, data
51+
----
52+
53+
We'll have an arrow file with the following columns:
54+
55+
- `count`
56+
- `name`
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
:page-role: procedure
2+
:table-caption!:
3+
= apoc.export.arrow.stream.all
4+
5+
[NOTE]
6+
====
7+
This procedure is not considered safe to run from multiple threads.
8+
It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13).
9+
For more information, see the link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/planning-and-tuning/runtimes/concepts#runtimes-parallel-runtime[Cypher Manual -> Parallel runtime].
10+
====
11+
12+
.Details
13+
|===
14+
| *Syntax* 3+| `apoc.export.arrow.stream.all([ config ]) :: (value)`
15+
| *Description* 3+| Exports the full database as an arrow byte array.
16+
.2+| *Input arguments* | *Name* | *Type* | *Description*
17+
| `config` | `MAP` | `{ batchSize = 2000 :: INTEGER }`. The default is: `{}`.
18+
.2+| *Return arguments* | *Name* | *Type* | *Description*
19+
| `value` | `BYTEARRAY` | The data as a bytearray.
20+
|===
21+
22+
== Usage Examples
23+
The procedure expose an Arrow byte[] for each batch of rows with the following structure
24+
- `<id>`: for node id
25+
- `<labels>`: list of labels
26+
- `<source.id>`: source node id (in case of relationship)
27+
- `<target.id>`: target node id (in case of relationship)
28+
- `<type>`: for relationship type
29+
- the list of properties of nodes and relationships flattened as table
30+
31+
So for the following query:
32+
33+
[source,cypher]
34+
----
35+
CREATE (f:User {name:'Adam',age:42,male:true,kids:['Sam','Anna','Grace'], born:localdatetime('2015185T19:32:24'), place:point({latitude: 13.1, longitude: 33.46789})})-[:KNOWS {since: 1993, bffSince: duration('P5M1.5D')}]->(b:User {name:'Jim',age:42}),(c:User {age:12}),(d:Another {foo: 'bar'})
36+
----
37+
38+
With this query:
39+
40+
[source,cypher]
41+
----
42+
CALL apoc.export.arrow.stream.all()
43+
----
44+
45+
We'll have a table with the following columns:
46+
47+
- `<id>`
48+
- `<labels>`
49+
- `<source.id>`
50+
- `<target.id>`
51+
- `<type>`
52+
- `name`
53+
- `age`
54+
- `male`
55+
- `kids`
56+
- `born`
57+
- `place`
58+
- `since`
59+
- `bffSince`
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
:page-role: procedure
2+
:table-caption!:
3+
= apoc.export.arrow.stream.graph
4+
5+
[NOTE]
6+
====
7+
This procedure is not considered safe to run from multiple threads.
8+
It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13).
9+
For more information, see the link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/planning-and-tuning/runtimes/concepts#runtimes-parallel-runtime[Cypher Manual -> Parallel runtime].
10+
====
11+
12+
.Details
13+
|===
14+
| *Syntax* 3+| `apoc.export.arrow.stream.graph(graph [, config ]) :: (value)`
15+
| *Description* 3+| Exports the given graph as an arrow byte array.
16+
.3+| *Input arguments* | *Name* | *Type* | *Description*
17+
| `graph` | `ANY` | The graph to export.
18+
| `config` | `MAP` | `{ batchSize = 2000 :: INTEGER }`. The default is: `{}`.
19+
.2+| *Return arguments* | *Name* | *Type* | *Description*
20+
| `value` | `BYTEARRAY` | The data as a bytearray.
21+
|===
22+
23+
== Usage Examples
24+
The procedure expose an Arrow byte[] for each batch of rows with the following structure
25+
- `<id>`: for node id
26+
- `<labels>`: list of labels
27+
- `<source.id>`: source node id (in case of relationship)
28+
- `<target.id>`: target node id (in case of relationship)
29+
- `<type>`: for relationship type
30+
- the list of properties of nodes and relationships flattened as table
31+
32+
So for the following query:
33+
34+
[source,cypher]
35+
----
36+
CREATE (f:User {name:'Adam',age:42,male:true,kids:['Sam','Anna','Grace'], born:localdatetime('2015185T19:32:24'), place:point({latitude: 13.1, longitude: 33.46789})})-[:KNOWS {since: 1993, bffSince: duration('P5M1.5D')}]->(b:User {name:'Jim',age:42}),(c:User {age:12}),(d:Another {foo: 'bar'})
37+
----
38+
39+
With this query:
40+
41+
[source,cypher]
42+
----
43+
CALL apoc.graph.fromDB('neo4j',{}) yield graph
44+
CALL apoc.export.arrow.stream.graph(graph)
45+
YIELD value RETURN value"
46+
----
47+
48+
We'll have a table with the following columns:
49+
50+
- `<id>`
51+
- `<labels>`
52+
- `<source.id>`
53+
- `<target.id>`
54+
- `<type>`
55+
- `name`
56+
- `age`
57+
- `male`
58+
- `kids`
59+
- `born`
60+
- `place`
61+
- `since`
62+
- `bffSince`

0 commit comments

Comments
 (0)