Commit a transaction

When you have executed all the statements for the transaction, and want to commit the changes to the database, you can use POST db/{name}/tx/{txid}/commit, which can also include any final statements to execute before committing.

Example request

  • POST http://localhost:7474/db/neo4j/tx/2/commit

  • Accept: application/json;charset=UTF-8

  • Content-Type: application/json

{
  "statements": [
    {
      "statement": "MATCH (n) WHERE id(n) = $nodeId RETURN n",
      "parameters": {
        "nodeId": 6
      }
    }
  ]
}

Example response

  • 200: OK

  • Content-Type: application/json;charset=utf-8

{
  "results" : [ {
    "columns" : [ "n" ],
    "data" : [ {
      "row" : [ { } ],
      "meta" : [ {
        "id" : 6,
        "type" : "node",
        "deleted" : false
      } ]
    } ]
  } ],
  "errors" : [ ]
}