Skip to content

Commit 05bf4ad

Browse files
update
1 parent d8782e9 commit 05bf4ad

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

modules/ROOT/pages/clauses/delete.adoc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,31 +127,25 @@ For more information, see link:{neo4j-docs-base-uri}/operations-manual/{page-ver
127127
[[delete-all-nodes-and-relationships]]
128128
== Delete all nodes and relationships
129129

130-
131130
It is possible to delete all nodes and relationships in a graph.
132131

133-
134132
.Delete all nodes and relationships
135133
[source, cypher, indent=0]
136134
----
137135
MATCH (n)
138136
DETACH DELETE n
139137
----
140138

141-
142139
.Result
143140
[role="queryresult",options="footer",cols="1*<m"]
144141
----
145142
Deleted 3 nodes, deleted 1 relationship
146143
----
147144

148-
149145
`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].
150146

151-
152147
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.
153148

154-
155149
.Delete all nodes and relationships using `CALL` subqueries
156150
[source, cypher]
157151
----
@@ -161,12 +155,10 @@ CALL (n) {
161155
} IN TRANSACTIONS
162156
----
163157

164-
165158
To delete everything in a database, including indexes and constraints, you can recreate the database using the following command: `CREATE OR REPLACE DATABASE name`.
166159
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`].
167160

168-
169-
.Delete everything in a database by recreating it
161+
.Delete everything in a database and recreate it
170162
[source, cypher]
171163
----
172164
CREATE OR REPLACE DATABASE neo4j

modules/ROOT/pages/queries/basic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,4 +903,4 @@ DETACH DELETE n
903903

904904
[NOTE]
905905
`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

Comments
 (0)