Skip to content

Commit 20f6834

Browse files
committed
update the Applying changes to data via CSV files section
1 parent 4634b96 commit 20f6834

File tree

1 file changed

+21
-33
lines changed

1 file changed

+21
-33
lines changed

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

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,13 +1426,11 @@ neo4j_home$ --nodes persons.csv --nodes games.csv --id-type string
14261426
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.
14271427
====
14281428

1429-
[role=label--new-2025.01.0 label--block-only]
1429+
[role=label--new-2025.01.0]
14301430
== Applying changes to data via CSV files
14311431

1432-
You can use CSV files to update your data during incremental import.
1433-
1434-
This feature is especially useful when you want to update existing nodes, relationships, labels, or properties in large datasets.
1435-
To be able to use this feature, each entity in the dataset must be associated with a unique ID.
1432+
You can use CSV files to update existing nodes, relationships, labels, or properties during incremental import.
1433+
To be able to do that, each entity in the dataset must be associated with a unique ID.
14361434

14371435
[NOTE]
14381436
====
@@ -1447,10 +1445,9 @@ If no action is specified, the import tool works as in full import mode, creatin
14471445
The following actions are supported:
14481446

14491447
* `empty` = `CREATE` (default)
1450-
* `C`, `CREATE` - Creates new nodes and relationships with or without properties.
1451-
* `U`, `UPDATE` - Updates existing nodes, relationships, or properties.
1452-
Leaving the property identifier empty is like having a “*” wild card.
1453-
* `D`, `DELETE` - Deletes an existing node or relationship.
1448+
* `C`, `CREATE` - Creates new nodes and relationships, with or without properties, as well as labels.
1449+
* `U`, `UPDATE` - Updates existing nodes, relationships, labels, and properties.
1450+
* `D`, `DELETE` - Deletes existing nodes or relationships.
14541451
Deleting a node also deletes its relationships (`DETACH DELETE`).
14551452

14561453

@@ -1465,58 +1462,49 @@ DELETE,4
14651462

14661463
=== Update existing labels
14671464

1468-
You can add or remove one or more labels from an existing node by prepending the clause `LABEL` in the header with a a `+` (default) or `-`:
1465+
You can add or remove one or more labels from an existing node by prepending the clause `LABEL` in the header with a `+` (default) or `-`:
14691466

14701467
* `:+LABEL` - Add one or more labels to an existing node.
14711468
* `:-LABEL` - Remove one or more labels (if they exist) from an existing node.
14721469

1473-
Multiple labels are separated by a semicolon.
1470+
Multiple labels are separated by a semicolon (default).
14741471

14751472
For example, a file could have the following format:
14761473

14771474
[source, csv]
14781475
----
1479-
p0:ID,:+LABEL,:-LABEL,name,age
1476+
:ID,:+LABEL,:-LABEL,name,age
14801477
person1,Actor,Person,"Keanu Reeves",55
14811478
person2,Actor;Director,Person,"Laurence Fishburne",60
14821479
person3,Actor,Person,"Carrie-Anne Moss",53
14831480
----
14841481

14851482
In this case, all labels in the second column are added and all the labels in the third column are removed (if they exist).
1486-
The nodes are identified by their `p0` key.
1487-
1488-
=== Update existing properties
1489-
1490-
You can add or remove properties from an existing entity by prepending the clause `PROPERTY` in the header with a `+` or `-`:
1483+
The nodes are identified by their `:ID`.
14911484

1492-
* `:+PROPERTY` - Add one or more properties (if they exist) to an existing entity.
1493-
* `:-PROPERTY` - Remove one or more properties (if they exist) from an existing entity.
1485+
=== Remove existing properties
14941486

1495-
Multiple properties are separated by a semicolon.
1496-
1497-
For example, a file could have the following format:
1487+
You can remove properties from existing nodes or relationships by specifying them after the keyword `:-PROPERTY` in the header file.
1488+
All nodes are identified by their `:ID` and all relationships by their `:START_ID`, `:END_ID`, and `:TYPE`.
1489+
For example:
14981490

1499-
.Update nodes' properties
1491+
.Remove nodes' properties
15001492
[source, cypher, role="nocopy"]
15011493
----
1502-
p0:ID,:LABEL,:+PROPERTY,:-PROPERTY
1503-
person1,Actor,role,description
1504-
person1,Actor;Director,role,description
1505-
person1,Actor,role,description
1494+
:ID,:LABEL,:-PROPERTY,age,hometown
1495+
person1,Actor,55,New York
15061496
----
15071497

1508-
In this case, all properties in the third column are added and all the properties in the fourth column are removed (if they exist).
1509-
The nodes are identified by their `p0` key.
1498+
Properties `age` and `hometown` are removed from the node with the `:ID` `person1`.
15101499

1511-
.Update relationships' properties
1500+
.Remove relationships' properties
15121501
[source, cypher, role="nocopy"]
15131502
----
1514-
:START_ID,:END_ID,:TYPE,:+PROPERTY,:-PROPERTY
1503+
:START_ID,:END_ID,:TYPE,:-PROPERTY, role, description
15151504
1,2,ACTED_IN,role,description
15161505
----
15171506

1518-
In this case, all properties in the fourth column are added and all the properties in the fifth column are removed (if they exist).
1519-
The relationships are identified by their `:START_ID`, `:END_ID`, and `:TYPE` keys.
1507+
Properties `role` and `description` are removed from the relationship with the `:START_ID` `1`, `:END_ID` `2`, and `:TYPE` `ACTED_IN`.
15201508

15211509
== Importing data that spans multiple lines
15221510

0 commit comments

Comments
 (0)