You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clauses/delete.adoc
+1-9Lines changed: 1 addition & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,31 +127,25 @@ For more information, see link:{neo4j-docs-base-uri}/operations-manual/{page-ver
127
127
[[delete-all-nodes-and-relationships]]
128
128
== Delete all nodes and relationships
129
129
130
-
131
130
It is possible to delete all nodes and relationships in a graph.
132
131
133
-
134
132
.Delete all nodes and relationships
135
133
[source, cypher, indent=0]
136
134
----
137
135
MATCH (n)
138
136
DETACH DELETE n
139
137
----
140
138
141
-
142
139
.Result
143
140
[role="queryresult",options="footer",cols="1*<m"]
144
141
----
145
142
Deleted 3 nodes, deleted 1 relationship
146
143
----
147
144
148
-
149
145
`DETACH DELETE` is useful when experimenting with small example datasets, but it is not suitable for deleting large amounts of data, nor does it delete xref:indexes/search-performance-indexes/overview.adoc[indexes] and xref:constraints/index.adoc[constraints].
150
146
151
-
152
147
To delete large amounts of data without deleting indexes and constraints, use xref::subqueries/subqueries-in-transactions.adoc#delete-with-call-in-transactions[CALL subqueries in transactions] instead.
153
148
154
-
155
149
.Delete all nodes and relationships using `CALL` subqueries
156
150
[source, cypher]
157
151
----
@@ -161,12 +155,10 @@ CALL (n) {
161
155
} IN TRANSACTIONS
162
156
----
163
157
164
-
165
158
To delete everything in a database, including indexes and constraints, you can recreate the database using the following command: `CREATE OR REPLACE DATABASE name`.
166
159
For more information, see the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/create-databases/#_create_databases_with_if_not_exists_or_or_replace[Operations Manual -> Create databases with `IF NOT EXISTS` or `OR REPLACE`].
Copy file name to clipboardExpand all lines: modules/ROOT/pages/queries/basic.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -903,4 +903,4 @@ DETACH DELETE n
903
903
904
904
[NOTE]
905
905
`DEATCH DELETE` is not suitable for deleting large amounts of data, nor does it delete xref:indexes/search-performance-indexes/overview.adoc[indexes] and xref:constraints/index.adoc[constraints].
906
-
For more information and alternatives to `DETACH DELETE`, see xref:clauses/delete.adoc#delete-all-nodes-and-relationships[`DELETE` -> Delete all nodes and relationships].
906
+
For more information, and alternatives to `DETACH DELETE`, see xref:clauses/delete.adoc#delete-all-nodes-and-relationships[`DELETE` -> Delete all nodes and relationships].
0 commit comments