Skip to content

Commit b331ad8

Browse files
committed
Updating data using actions in CSV files
1 parent ab73af7 commit b331ad8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

modules/ROOT/pages/tools/neo4j-admin/neo4j-admin-import.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,34 @@ neo4j_home$ --nodes persons.csv --nodes games.csv --id-type string
14411441
The `id` property of the nodes in the `persons` group will be stored as `long` type, while the `id` property of the nodes in the `games` group will be stored as `string` type, as the global `id-type` is a string.
14421442
====
14431443

1444+
[role=label--new-5.26]
1445+
[[import-tool-actions-csv-files]]
1446+
== Updating data using actions in CSV files
1447+
1448+
You can use actions in CSV files to update data during incremental import.
1449+
This feature is especially useful when you want to update existing nodes or relationships in large datasets.
1450+
1451+
In the header file, you can specify whether an action should be taken for the data in the fields using the `:ACTION` keyword.
1452+
If no action is specified, the import tool works as in full import mode, creating new data.
1453+
1454+
The following actions are supported:
1455+
1456+
* `empty` = `CREATE` (default)
1457+
* `C`, `CREATE` - Creates a new entity.
1458+
* `U`, `UPDATE` - Updates an existing entity.
1459+
* `D`, `DELETE` - Deletes an existing entity.
1460+
Deleting a node also deletes its relationships (`DETACH DELETE`).
1461+
1462+
On each row in the data file, you can specify the action for the data in the fields.
1463+
1464+
.Using actions in CSV files to update data
1465+
[source, cypher, role="nocopy"]
1466+
----
1467+
:ACTION,personId:ID,name,:LABEL
1468+
CREATE,1,"Keanu Reeves",Actor
1469+
UPDATE,2,"Laurence Fishburne",Actor
1470+
DELETE,4
1471+
----
14441472

14451473
== Importing data that spans multiple lines
14461474

0 commit comments

Comments
 (0)