8000 correction for drop graph, collection handling (#1012) · arangodb/docs@28b08ed · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit 28b08ed

Browse files
cw00dw0rdSimran-B
andauthored
correction for drop graph, collection handling (#1012)
* correction for drop graph, collection handling * adds simran suggestion * applies changes to satellite as well * Undo changes to EoL versions * Review Co-authored-by: Simran Spiller <simran@arangodb.com>
1 parent 4553bf6 commit 28b08ed

6 files changed

+66
-42
lines changed

3.10/graphs-satellite-graphs-management.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,27 +197,31 @@ sharding for other collections (`edges`).
197197
{% endarangoshexample %}
198198
{% include arangoshexample.html id=examplevar script=script result=result %}
199199

200-
You may drop the complete graph, but remember to drop collections that you
201-
might have removed from the graph beforehand, as they will not be part of the
202-
graph definition anymore and thus not be dropped for you. Alternatively, you
203-
can `truncate` the graph if you just want to get rid of the data.
200+
You may drop the complete graph including the underlying collections by setting
201+
the second argument in the call to `_drop()` to `true`. This will only drop
202+
collections that are in the graph definition at that point. Remember to manually
203+
drop collections that you might have removed from the graph beforehand.
204204

205205
{% arangoshexample examplevar="examplevar" script="script" result="result" %}
206206
@startDocuBlockInline satelliteGraphManagementModify5_cluster
207207
@EXAMPLE_ARANGOSH_OUTPUT{satelliteGraphManagementModify5_cluster}
208208
var graph_module = require("@arangodb/satellite-graph");
209209
var relation = graph_module._relation("edges", "vertices", "vertices");
210210
var graph = graph_module._create("myGraph", [relation], []);
211-
graph._deleteEdgeDefinition("edges");
212-
graph._removeVertexCollection("vertices");
213-
graph_module._drop("myGraph", true); // does not drop any collections
211+
graph._deleteEdgeDefinition("edges"); // Remove edge collection from graph definition
212+
graph._removeVertexCollection("vertices"); // Remove vertex collection from graph definition
213+
graph_module._drop("myGraph", true); // Does not drop any collections because none are left in the graph definition
214+
// Manually clean up the collections that were left behind
214215
db._drop("edges"); // drop before sharding-defining 'vertices' collection
215216
db._drop("vertices");
216217
@END_EXAMPLE_ARANGOSH_OUTPUT
217218
@endDocuBlock satelliteGraphManagementModify5_cluster
218219
{% endarangoshexample %}
219220
{% include arangoshexample.html id=examplevar script=script result=result %}
220221

222+
Alternatively, you can `truncate()` all collections of the graph if you just
223+
want to get rid of the data but keep the collections and graph definition.
224+
221225
### Remove an edge collection
222226

223227
Delete an edge definition from the graph:

3.10/graphs-smart-graphs-management.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,27 +230,31 @@ sharding for other collections (`edges`).
230230
{% endarangoshexample %}
231231
{% include arangoshexample.html id=examplevar script=script result=result %}
232232

233-
You may drop the complete graph, but remember to drop collections that you
234-
might have removed from the graph beforehand, as they will not be part of the
235-
graph definition anymore and thus not be dropped automatically. Alternatively, you
236-
can `truncate` all collections from the graph if you just want to get rid of the data.
233+
You may drop the complete graph including the underlying collections by setting
234+
the second argument in the call to `_drop()` to `true`. This will only drop
235+
collections that are in the graph definition at that point. Remember to manually
236+
drop collections that you might have removed from the graph beforehand.
237237

238238
{% arangoshexample examplevar="examplevar" script="script" result="result" %}
239239
@startDocuBlockInline smartGraphModify5_cluster
240240
@EXAMPLE_ARANGOSH_OUTPUT{smartGraphModify5_cluster}
241241
var graph_module = require("@arangodb/smart-graph");
242242
var relation = graph_module._relation("edges", "vertices", "vertices");
243243
var graph = graph_module._create("myGraph", [relation], [], {smartGraphAttribute: "region", numberOfShards: 9});
244-
graph._deleteEdgeDefinition("edges");
245-
graph._removeVertexCollection("vertices");
246-
graph_module._drop("myGraph", true); // does not drop any collections
244+
graph._deleteEdgeDefinition("edges"); // Remove edge collection from graph definition
245+
graph._removeVertexCollection("vertices"); // Remove vertex collection from graph definition
246+
graph_module._drop("myGraph", true); // Does not drop any collections because none are left in the graph definition
247+
// Manually clean up the collections that were left behind
247248
db._drop("edges"); // drop before sharding-defining 'vertices' collection
248249
db._drop("vertices");
249250
@END_EXAMPLE_ARANGOSH_OUTPUT
250251
@endDocuBlock smartGraphModify5_cluster
251252
{% endarangoshexample %}
252253
{% include arangoshexample.html id=examplevar script=script result=result %}
253254

255+
Alternatively, you can `truncate()` all collections of the graph if you just
256+
want to get rid of the data but keep the collections and graph definition.
257+
254258
### Remove an edge collection
255259

256260
Delete an edge definition from the graph:

3.8/graphs-satellite-graphs-management.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,27 +197,31 @@ sharding for other collections (`edges`).
197197
{% endarangoshexample %}
198198
{% include arangoshexample.html id=examplevar script=script result=result %}
199199

200-
You may drop the complete graph, but remember to drop collections that you
201-
might have removed from the graph beforehand, as they will not be part of the
202-
graph definition anymore and thus not be dropped for you. Alternatively, you
203-
can `truncate` the graph if you just want to get rid of the data.
200+
You may drop the complete graph including the underlying collections by setting
201+
the second argument in the call to `_drop()` to `true`. This will only drop
202+
collections that are in the graph definition at that point. Remember to manually
203+
drop collections that you might have removed from the graph beforehand.
204204

205205
{% arangoshexample examplevar="examplevar" script="script" result="result" %}
206206
@startDocuBlockInline satelliteGraphManagementModify5_cluster
207207
@EXAMPLE_ARANGOSH_OUTPUT{satelliteGraphManagementModify5_cluster}
208208
var graph_module = require("@arangodb/satellite-graph");
209209
var relation = graph_module._relation("edges", "vertices", "vertices");
210210
var graph = graph_module._create("myGraph", [relation], []);
211-
graph._deleteEdgeDefinition("edges");
212-
graph._removeVertexCollection("vertices");
213-
graph_module._drop("myGraph", true); // does not drop any collections
211+
graph._deleteEdgeDefinition("edges"); // Remove edge collection from graph definition
212+
graph._removeVertexCollection("vertices"); // Remove vertex collection from graph definition
213+
graph_module._drop("myGraph", true); // Does not drop any collections because none are left in the graph definition
214+
// Manually clean up the collections that were left behind
214215
db._drop("edges"); // drop before sharding-defining 'vertices' collection
215216
db._drop("vertices");
216217
@END_EXAMPLE_ARANGOSH_OUTPUT
217218
@endDocuBlock satelliteGraphManagementModify5_cluster
218219
{% endarangoshexample %}
219220
{% include arangoshexample.html id=examplevar script=script result=result %}
220221

222+
Alternatively, you can `truncate()` all collections of the graph if you just
223+
want to get rid of the data but keep the collections and graph definition.
224+
221225
### Remove an edge collection
222226

223227
Delete an edge definition from the graph:

3.8/graphs-smart-graphs-management.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,27 +221,31 @@ sharding for other collections (`edges`).
221221
{% endarangoshexample %}
222222
{% include arangoshexample.html id=examplevar script=script result=result %}
223223

224-
You may drop the complete graph, but remember to drop collections that you
225-
might have removed from the graph beforehand, as they will not be part of the
226-
graph definition anymore and thus not be dropped for you. Alternatively, you
227-
can `truncate` the graph if you just want to get rid of the data.
224+
You may drop the complete graph including the underlying collections by setting
225+
the second argument in the call to `_drop()` to `true`. This will only drop
226+
collections that are in the graph definition at that point. Remember to manually
227+
drop collections that you might have removed from the graph beforehand.
228228

229229
{% arangoshexample examplevar="examplevar" script="script" result="result" %}
230230
@startDocuBlockInline smartGraphModify5_cluster
231231
@EXAMPLE_ARANGOSH_OUTPUT{smartGraphModify5_cluster}
232232
var graph_module = require("@arangodb/smart-graph");
233233
var relation = graph_module._relation("edges", "vertices", "vertices");
234234
var graph = graph_module._create("myGraph", [relation], [], {smartGraphAttribute: "region", numberOfShards: 9});
235-
graph._deleteEdgeDefinition("edges");
236-
graph._removeVertexCollection("vertices");
237-
graph_module._drop("myGraph", true); // does not drop any collections
235+
graph._deleteEdgeDefinition("edges"); // Remove edge collection from graph definition
236+
graph._removeVertexCollection("vertices"); // Remove vertex collection from graph definition
237+
graph_module._drop("myGraph", true); // Does not drop any collections because none are left in the graph definition
238+
// Manually clean up the collections that were left behind
238239
db._drop("edges"); // drop before sharding-defining 'vertices' collection
239240
db._drop("vertices");
240241
@END_EXAMPLE_ARANGOSH_OUTPUT
241242
@endDocuBlock smartGraphModify5_cluster
242243
{% endarangoshexample %}
243244
{% include arangoshexample.html id=examplevar script=script result=result %}
244245

246+
Alternatively, you can `truncate()` all collections of the graph if you just
247+
want to get rid of the data but keep the collections and graph definition.
248+
245249
### Remove an edge collection
246250

247251
Delete an edge definition from the graph:

3.9/graphs-satellite-graphs-management.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,27 +197,31 @@ sharding for other collections (`edges`).
197197
{% endarangoshexample %}
198198
{% include arangoshexample.html id=examplevar script=script result=result %}
199199

200-
You may drop the complete graph, but remember to drop collections that you
201-
might have removed from the graph beforehand, as they will not be part of the
202-
graph definition anymore and thus not be dropped for you. Alternatively, you
203-
can `truncate` the graph if you just want to get rid of the data.
200+
You may drop the complete graph including the underlying collections by setting
201+
the second argument in the call to `_drop()` to `true`. This will only drop
202+
collections that are in the graph definition at that point. Remember to manually
203+
drop collections that you might have removed from the graph beforehand.
204204

205205
{% arangoshexample examplevar="examplevar" script="script" result="result" %}
206206
@startDocuBlockInline satelliteGraphManagementModify5_cluster
207207
@EXAMPLE_ARANGOSH_OUTPUT{satelliteGraphManagementModify5_cluster}
208208
var graph_module = require("@arangodb/satellite-graph");
209209
var relation = graph_module._relation("edges", "vertices", "vertices");
210210
var graph = graph_module._create("myGraph", [relation], []);
211-
graph._deleteEdgeDefinition("edges");
212-
graph._removeVertexCollection("vertices");
213-
graph_module._drop("myGraph", true); // does not drop any collections
211+
graph._deleteEdgeDefinition("edges"); // Remove edge collection from graph definition
212+
graph._removeVertexCollection("vertices"); // Remove vertex collection from graph definition
213+
graph_module._drop("myGraph", true); // Does not drop any collections because none are left in the graph definition
214+
// Manually clean up the collections that were left behind
214215
db._drop("edges"); // drop before sharding-defining 'vertices' collection
215216
db._drop("vertices");
216217
@END_EXAMPLE_ARANGOSH_OUTPUT
217218
@endDocuBlock satelliteGraphManagementModify5_cluster
218219
{% endarangoshexample %}
219220
{% include arangoshexample.html id=examplevar script=script result=result %}
220221

222+
Alternatively, you can `truncate()` all collections of the graph if you just
223+
want to get rid of the data but keep the collections and graph definition.
224+
221225
### Remove an edge collection
222226

223227
Delete an edge definition from the graph:

3.9/graphs-smart-graphs-management.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,27 +226,31 @@ sharding for other collections (`edges`).
226226
{% endarangoshexample %}
227227
{% include arangoshexample.html id=examplevar script=script result=result %}
228228

229-
You may drop the complete graph, but remember to drop collections that you
230-
might have removed from the graph beforehand, as they will not be part of the
231-
graph definition anymore and thus not be dropped for you. Alternatively, you
232-
can `truncate` the graph if you just want to get rid of the data.
229+
You may drop the complete graph including the underlying collections by setting
230+
the second argument in the call to `_drop()` to `true`. This will only drop
231+
collections that are in the graph definition at that point. Remember to manually
232+
drop collections that you might have removed from the graph beforehand.
233233

234234
{% arangoshexample examplevar="examplevar" script="script" result="result" %}
235235
@startDocuBlockInline smartGraphModify5_cluster
236236
@EXAMPLE_ARANGOSH_OUTPUT{smartGraphModify5_cluster}
237237
var graph_module = require("@arangodb/smart-graph");
238238
var relation = graph_module._relation("edges", "vertices", "vertices");
239239
var graph = graph_module._create("myGraph", [relation], [], {smartGraphAttribute: "region", numberOfShards: 9});
240-
graph._deleteEdgeDefinition("edges");
241-
graph._removeVertexCollection("vertices");
242-
graph_module._drop("myGraph", true); // does not drop any collections
240+
graph._deleteEdgeDefinition("edges"); // Remove edge collection from graph definition
241+
graph._removeVertexCollection("vertices"); // Remove vertex collection from graph definition
242+
graph_module._drop("myGraph", true); // Does not drop any collections because none are left in the graph definition
243+
// Manually clean up the collections that were left behind
243244
db._drop("edges"); // drop before sharding-defining 'vertices' collection< 1241 /div>
244245
db._drop("vertices");
245246
@END_EXAMPLE_ARANGOSH_OUTPUT
246247
@endDocuBlock smartGraphModify5_cluster
247248
{% endarangoshexample %}
248249
{% include arangoshexample.html id=examplevar script=script result=result %}
249250

251+
Alternatively, you can `truncate()` all collections of the graph if you just
252+
want to get rid of the data but keep the collections and graph definition.
253+
250254
### Remove an edge collection
251255

252256
Delete an edge definition from the graph:

0 commit comments

Comments
 (0)
0