Change event schema
This feature has been released as a public beta in AuraDB Enterprise October Release and Neo4j Enterprise Edition 5.13 and breaking changes are likely to be introduced before it is made generally available (GA). |
Contents of change events differ by the underlying entity.
Node Changes
Change events for nodes follow this schema:
{
"id": "A7fjWXMK_0L6hztd4xhoy0oAAAAAAAAADAAAAAAAAAAA", (1)
"txId": 12, (2)
"seq": 0, (3)
"metadata": {
"executingUser": "neo4j", (4)
"authenticatedUser": "neo4j", (5)
"captureMode": "FULL", (6)
"connectionClient": "127.0.0.1:51320", (7)
"serverId": "e605bd8f", (8)
"databaseId": "edec6ba8-e82f-4aac-ae41-2725f2357fdd", (9)
"connectionType": "bolt", (10)
"connectionServer": "127.0.0.1:51316", (11)
"txStartTime": "2023-03-03T11:58:30.429Z", (12)
"txCommitTime": "2023-03-03T11:58:30.526Z", (13)
"txMetadata": { (14)
"correlationId": "123456789"
}
},
"event": {
"elementId": "4:b7e35973-0aff-42fa-873b-5de31868cb4a:1", (15)
"keys": { (16)
"userId": "1001",
"name": "John",
"lastName": "Doe"
},
"eventType": "n", (17)
"state": {
"before": null, (18)
"after": { (19)
"properties": { (20)
"tagline": "Houston, we have a problem.",
"title": "Apollo 13",
"released": "1995"
},
"labels": ["MOVIE"] (21)
}
},
"operation": "c", (22)
"labels": ["MOVIE"] (23)
}
}
1 | A unique change identifier that identifies this change record. Used as a cursor to continue querying changes from last processed change. |
2 | A number identifying which transaction the change happened in, unique in combination with seq .
Transaction identifiers are not continuous.
Some transactions, such as system and schema commands, are not recorded in change data capture and cause gaps in the transaction identifiers. |
3 | A number used for ordering changes happened in the same transaction. Note that the order of changes observed in the output does not necessarily correspond to the order of changes applied during the transaction. |
4 | The user that performed this change.
May be different from authenticatedUser when using impersonation.
See Operations Manual → Authentication and authorization → Manage privileges → DBMS privileges for more information on impersonation. |
5 | The authenticated user when this change was performed. |
6 | The transaction log enrichment mode at the time this change was captured. |
7 | The client’s address (usually IP address and port but might change based on protocol). |
8 | The identifier of the server that performed this change. See Operations Manual → Clustering → Managing servers in a cluster for more information on servers. |
9 | The database unique ID. See Operations Manual → Database administration for more information on managing multiple databases. |
10 | The protocol under which the client is connected through. |
11 | The server’s address (usually IP address and port but might change based on protocol). |
12 | The timestamp when the underlying transaction started. |
13 | The timestamp when the underlying transaction committed. |
14 | The metadata associated with the transaction when the operation was performed. |
15 | The element id of the changed entity (node or relationship). See Cypher Manual → Functions → Scalar functions for more information on element ids. |
16 | The keys identifying the changed entity. Requires specific constraint types defined on entities, see Capturing key properties for details. |
17 | Type of the changed entity: n for nodes and r for relationships. |
18 | A map describing the state of the entity before the change.
This field is always NULL for create events.
When on DIFF enrichment mode, it is limited to the properties and labels of the entity that have changed.
See enrichment mode for details.
This field always contains the full state of the entity for delete events, regardless of the enrichment mode being set to DIFF or FULL . |
19 | A map describing the state of the entity after the change.
This field is always NULL for delete events.
When on DIFF enrichment mode, it is limited to the properties and labels of the entity that have changed.
See enrichment mode for details.
This field always contains the full state of the entity for create events, regardless of the enrichment mode being set to DIFF or FULL . |
20 | A map of properties of the entity after the change. |
21 | List of labels of the node after the change has been applied.
When on DIFF enrichment mode, it is limited to the changed labels.
See enrichment mode for details. |
22 | Type of the operation: c for creates, u for updates, and d for deletions. |
23 | List of labels of the changed node.
This list is always populated from the before state of the node.
It contains the complete set of labels regardless of the enrichment mode. |
Relationship changes
Change events for relationships follow a similar schema to node changes. Note that only the differences are annotated below.
{
"id": "A2pK9P_aOknnrnEsCsPB_BoAAAAAAAAADwAAAAAAAAAA",
"txId": 15,
"seq": 0,
"metadata": {
"executingUser": "neo4j",
"authenticatedUser": "neo4j",
"captureMode": "FULL",
"connectionClient": "127.0.0.1:51190",
"serverId": "2230d17a",
"databaseId": "edec6ba8-e82f-4aac-ae41-2725f2357fdd",
"connectionType": "bolt",
"connectionServer": "127.0.0.1:51186",
"txStartTime": "2023-03-03T11:54:40.510Z",
"txCommitTime": "2023-03-03T11:54:40.773Z",
"txMetadata": {
"correlationId": "987654321"
}
},
"event": {
"elementId": "5:6a4af4ff-da3a-49e7-ae71-2c0ac3c1fc1a:0",
"start": { (1)
"elementId": "4:6a4af4ff-da3a-49e7-ae71-2c0ac3c1fc1a:0", (2)
"keys": {}, (3)
"labels": ["PERSON"] (4)
},
"end": { (5)
"elementId": "4:6a4af4ff-da3a-49e7-ae71-2c0ac3c1fc1a:1",
"keys": {},
"labels": [
"MOVIE"
]
},
"eventType": "r",
"state": {
"before": null,
"after": {
"properties": {
"roles": "Jack Swigert"
}
(6)
}
},
"type": "ACTED_IN", (7)
"operation": "c",
"key": {}
}
}
1 | A map containing information about the start node. |
2 | Element id of the start node. |
3 | Keys (if related constraints are defined) of the start node. |
4 | List of labels of the start node. |
5 | Same set of information defined above for the end node. |
6 | Since relationships do not have labels, there is no field for labels in the before / after state. |
7 | Relationship type. |
Was this page helpful?