Transaction ConfigurationDeprecated in 5.26Not available on Aura
For any transaction-initiating request (such as /tx
or tx/commit
), you can provide configuration options that apply for the duration of the whole transaction.
Access Mode
To ensure efficient load balancing across a cluster, it is important to label transactions that only contain READ
statements with a READ
access mode.
This can be done by adding an access-mode
header to the request, with a value of READ
.
If an However, if you have clusters with Server-side routing disabled, the default value is |
|
Example request
-
POST http://localhost:7474/db/neo4j/tx/commit
-
Accept: application/json;charset=UTF-8
-
Content-Type: application/json
-
Access-Mode: WRITE
{
"statements": [
{
"statement": "CREATE (n) RETURN n"
}
]
}
Example response
-
200: OK
-
Content-Type: application/json;charset=utf-8
{
"results" : [ {
"columns" : [ "n" ],
"data" : [ {
"row" : [ { } ],
"meta" : [ {
"id" : 7,
"type" : "node",
"deleted" : false
} ]
} ]
} ],
"errors" : [ ]
}