Skip to content

Commit 109955a

Browse files
Make legacy API and its deprecation more prominent (#46)
* Create new page for legacy endpoints * Add new page for legacy endpoints * Remove header from previous page
1 parent cf3d18e commit 109955a

File tree

4 files changed

+66
-55
lines changed

4 files changed

+66
-55
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
** xref:actions/commit-an-open-transaction.adoc[]
1111
** xref:actions/rollback-an-open-transaction.adoc[]
1212
** xref:actions/begin-and-commit-a-transaction-in-one-request.adoc[]
13+
** xref:actions/legacy-endpoints.adoc[]
1314
** xref:actions/execute-multiple-statements.adoc[]
1415
** xref:actions/include-query-statistics.adoc[]
1516
** xref:actions/return-results-in-graph-format.adoc[]

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

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
[[http-api-begin-and-commit-a-transaction-in-one-request]]
44
= Begin and commit a transaction in one request
55

6-
== Begin and commit request
7-
86
If there is no need to keep a transaction open across multiple HTTP requests, you can begin a transaction, execute statements, and commit within a single HTTP request.
97

108
_Example request_
@@ -49,55 +47,3 @@ _Example response_
4947
"errors" : [ ]
5048
}
5149
----
52-
53-
54-
== Legacy Endpoints label:deprecated[]
55-
56-
[IMPORTANT]
57-
====
58-
The API described in this section of the manual has been deprecated and will be removed in Neo4j 5.0.
59-
====
60-
61-
_Example request_
62-
63-
* *+POST+* +http://localhost:7474/db/neo4j/tx/commit+
64-
* *+Accept:+* +application/json;charset=UTF-8+
65-
* *+Content-Type:+* +application/json+
66-
67-
[source, JSON, role="nocopy"]
68-
----
69-
{
70-
"statements": [
71-
{
72-
"statement": "MATCH (n) WHERE id(n) = $nodeId RETURN n",
73-
"parameters": {
74-
"nodeId": 2
75-
}
76-
}
77-
]
78-
}
79-
----
80-
81-
_Example response_
82-
83-
* *+200:+* +OK+
84-
* *+Content-Type:+* +application/json;charset=utf-8+
85-
86-
[source, JSON, role="nocopy"]
87-
----
88-
{
89-
"results" : [ {
90-
"columns" : [ "n" ],
91-
"data" : [ {
92-
"row" : [ { } ],
93-
"meta" : [ {
94-
"id" : 2,
95-
"type" : "node",
96-
"deleted" : false
97-
} ]
98-
} ]
99-
} ],
100-
"errors" : [ ]
101-
}
102-
----
103-

modules/ROOT/pages/actions/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ There are several _actions_ that can be performed using the Cypher transaction H
1818
* xref:actions/commit-an-open-transaction.adoc[]
1919
* xref:actions/rollback-an-open-transaction.adoc[]
2020
* xref:actions/begin-and-commit-a-transaction-in-one-request.adoc[]
21+
* xref:actions/legacy-endpoints.adoc[]
2122

2223
*Additional actions:*
2324

@@ -30,4 +31,3 @@ There are several _actions_ that can be performed using the Cypher transaction H
3031
* xref:actions/expired-transactions.adoc[]
3132
* xref:actions/handling-errors.adoc[]
3233
* xref:actions/handling-errors-in-an-open-transaction.adoc[]
33-
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
:description: Legacy endpoints.
2+
3+
[[http-api-legacy-endpoints]]
4+
= [deprecated]#Legacy Endpoints#
5+
6+
[IMPORTANT]
7+
====
8+
The API described in this section of the manual has been deprecated and will be removed in Neo4j 5.0.
9+
====
10+
11+
For backwards compatibility with neo4j 3.5, it is still possible to use the HTTP API without specifying the database in the URL.
12+
For example:
13+
14+
`http://localhost:7474/db/data/transaction/commit`.
15+
16+
Since the database is not specified, the statements will be executed against the user's _global default database_.
17+
18+
All endpoints can also be executed against the legacy API, where `db/<database-name>` is replaced with `db/data/transaction`.
19+
The input format and output format are identical for both the legacy API and the current API.
20+
21+
For example, beginning and committing a transaction in a single requests looks as follows:
22+
23+
_Example request_
24+
25+
* *+POST+* +http://localhost:7474/db/data/transaction/commit+
26+
* *+Accept:+* +application/json;charset=UTF-8+
27+
* *+Content-Type:+* +application/json+
28+
29+
[source, JSON, role="nocopy"]
30+
----
31+
{
32+
"statements": [
33+
{
34+
"statement": "MATCH (n) WHERE id(n) = $nodeId RETURN n",
35+
"parameters": {
36+
"nodeId": 2
37+
}
38+
}
39+
]
40+
}
41+
----
42+
43+
_Example response_
44+
45+
* *+200:+* +OK+
46+
* *+Content-Type:+* +application/json;charset=utf-8+
47+
48+
[source, JSON, role="nocopy"]
49+
----
50+
{
51+
"results" : [ {
52+
"columns" : [ "n" ],
53+
"data" : [ {
54+
"row" : [ { } ],
55+
"meta" : [ {
56+
"id" : 2,
57+
"type" : "node",
58+
"deleted" : false
59+
} ]
60+
} ]
61+
} ],
62+
"errors" : [ ]
63+
}
64+
----

0 commit comments

Comments
 (0)