Skip to content

Commit 1370657

Browse files
Neo4j 4.1
1 parent 5b6ea03 commit 1370657

File tree

11 files changed

+170
-473
lines changed

11 files changed

+170
-473
lines changed

antora.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: http-api
22
title: HTTP API
3-
version: '4.4-preview'
4-
prerelease: true
3+
version: '4.1'
4+
prerelease: false
55
start_page: ROOT:index.adoc
66
nav:
77
- modules/ROOT/content-nav.adoc
88
asciidoc:
99
attributes:
10-
neo4j-version: '4.4'
11-
neo4j-version-exact: '4.4.0'
12-
neo4j-buildnumber: '4.4'
10+
neo4j-version: '4.1'
11+
neo4j-version-exact: '4.10.0'
12+
neo4j-buildnumber: '4.1'

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* xref:discovery.adoc[]
44
* xref:actions/index.adoc[]
55
** xref:actions/transaction-flow.adoc[]
6-
** xref:actions/query-format.adoc[]
7-
** xref:actions/result-format.adoc[]
6+
** xref:actions/query-result.adoc[]
87
** xref:actions/begin-a-transaction.adoc[]
98
** xref:actions/execute-statements-in-an-open-transaction.adoc[]
109
** xref:actions/reset-transaction-timeout-of-an-open-transaction.adoc[]

modules/ROOT/pages/actions/begin-and-commit-a-transaction-in-one-request.adoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ _Example response_
5858
The API described in this section of the manual has been deprecated and will be removed in Neo4j 5.0.
5959
====
6060

61-
Starting with Neo4j version 4.3, statements submitted via these endpoints will be processed by the user's respective _home database_.
62-
Previous versions rely on the the globally configured _default database_.
63-
6461
_Example request_
6562

6663
* *+POST+* +http://localhost:7474/db/neo4j/tx/commit+

modules/ROOT/pages/actions/handling-errors.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If errors occur while executing statements, the server will roll back the transa
1414

1515
In this example, we send an invalid statement to the server in order to demonstrate error handling.
1616

17-
For more information on the status codes, see xref:4.4-preview@status-codes:ROOT:index.adoc[Neo4j Status Codes].
17+
For more information on the status codes, see xref:4.1@status-codes:ROOT:index.adoc[Neo4j Status Codes].
1818

1919
_Example request_
2020

modules/ROOT/pages/actions/index.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ There are several _actions_ that can be performed using the Cypher transaction H
88
*Concepts:*
99

1010
* xref:actions/transaction-flow.adoc[]
11-
* xref:actions/query-format.adoc[]
12-
* xref:actions/result-format.adoc[]
11+
* xref:actions/query-result.adoc[]
1312

1413
*Using the API:*
1514

modules/ROOT/pages/actions/query-format.adoc

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
:description: HTTP API query and result format.
2+
3+
= Query and result format
4+
5+
6+
[[http-api-actions-query-format]]
7+
== Query format
8+
9+
All transaction POST requests can accept one or more Cypher queries within the request payload.
10+
This enables a large amount of flexibility in how, and when, queries are sent, and can help to reduce the number of individual HTTP requests overall.
11+
12+
The payload is sent as JSON with the following general structure:
13+
14+
[source, JSON, role="nocopy"]
15+
----
16+
{
17+
"statements": [
18+
{
19+
"statement": "...",
20+
"parameters": {...}
21+
},
22+
{
23+
"statement": "...",
24+
"parameters": {...}
25+
},
26+
...
27+
]
28+
}
29+
----
30+
31+
For example:
32+
33+
[source, JSON, role="nocopy"]
34+
----
35+
{
36+
"statements": [
37+
{
38+
"statement": "CREATE (n $props) RETURN n",
39+
"parameters": {
40+
"props": {
41+
"name": "My Node"
42+
}
43+
}
44+
},
45+
{
46+
"statement": "CREATE (n $props) RETURN n",
47+
"parameters": {
48+
"props": {
49+
"name": "Another Node"
50+
}
51+
}
52+
}
53+
]
54+
}
55+
----
56+
57+
Parameters are included as key-value pairs, with each value adopting a type that corresponds to an entry in the mapping table below:
58+
59+
.HTTP API parameter type mappings
60+
[options="header", cols="m,a"]
61+
|===
62+
| JSON Type
63+
| Cypher Type
64+
65+
| null
66+
| Null
67+
68+
| boolean
69+
| Boolean
70+
71+
| number
72+
| Float
73+
74+
| string
75+
| String
76+
77+
| array
78+
| List
79+
80+
| object
81+
| Map
82+
|===
83+
84+
[[http-api-actions-result-format]]
85+
== Result format
86+
87+
The HTTP API for Neo4j v{neo4j-version}, only support JSON as the result format.
88+
It contains an embedded `results` element.
89+
To request this format, place `application/json` in the `Accept` header.
90+
This format is the default returned if no `Accept` header is provided.
91+
92+
[source, JSON, role="nocopy"]
93+
----
94+
{
95+
"results": [
96+
{
97+
"columns": [],
98+
"data": [
99+
{
100+
"row": [ row-data ],
101+
"meta": [ metadata ]
102+
},
103+
{
104+
105+
}
106+
]
107+
},
108+
{
109+
//another statement’s results
110+
}
111+
]
112+
}
113+
----
114+
115+
For example, running the query `UNWIND range(0, 2, 1) AS number RETURN number` will return the following results:
116+
117+
[source, JSON, role="nocopy"]
118+
----
119+
{
120+
"results": [
121+
{
122+
"columns": [
123+
"number"
124+
],
125+
"data": [
126+
{
127+
"row": [
128+
0
129+
],
130+
"meta": [
131+
null
132+
]
133+
},
134+
{
135+
"row": [
136+
1
137+
],
138+
"meta": [
139+
null
140+
]
141+
},
142+
{
143+
"row": [
144+
2
145+
],
146+
"meta": [
147+
null
148+
]
149+
}
150+
]
151+
}
152+
],
153+
// other transactional data
154+
}
155+
----
156+

0 commit comments

Comments
 (0)