Skip to content

Commit a66c150

Browse files
committed
Document Graph collection remove methods
1 parent 52e9e4c commit a66c150

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ try {
215215
* [graph.removeEdgeDefinition](#graphremoveedgedefinition)
216216
* [graph.traversal](#graphtraversal)
217217
* [GraphVertexCollection API](#graphvertexcollection-api)
218+
* [graphVertexCollection.remove](#graphvertexcollectionremove)
218219
* [graphVertexCollection.vertex](#graphvertexcollectionvertex)
219220
* [graphVertexCollection.save](#graphvertexcollectionsave)
220221
* [GraphEdgeCollection API](#graphedgecollection-api)
222+
* [graphEdgeCollection.remove](#graphedgecollectionremove)
221223
* [graphEdgeCollection.edge](#graphedgecollectionedge)
222224
* [graphEdgeCollection.save](#graphedgecollectionsave)
223225
* [graphEdgeCollection.edges](#graphedgecollectionedges)
@@ -3312,6 +3314,37 @@ collection.import([
33123314
33133315
The *GraphVertexCollection API* extends the [*Collection API* (see above)](#collection-api) with the following methods.
33143316
3317+
#### graphVertexCollection.remove
3318+
3319+
`async graphVertexCollection.remove(documentHandle): Object`
3320+
3321+
Deletes the vertex with the given *documentHandle* from the collection.
3322+
3323+
**Arguments**
3324+
3325+
* **documentHandle**: `string`
3326+
3327+
The handle of the vertex to retrieve. This can be either the `_id` or the `_key` of a vertex in the collection, or a vertex (i.e. an object with an `_id` or `_key` property).
3328+
3329+
**Examples**
3330+
3331+
```js
3332+
var graph = db.graph('some-graph');
3333+
var collection = graph.vertexCollection('vertices');
3334+
3335+
collection.remove('some-key')
3336+
.then(() => {
3337+
// document 'vertices/some-key' no longer exists
3338+
});
3339+
3340+
// -- or --
3341+
3342+
collection.remove('vertices/some-key')
3343+
.then(() => {
3344+
// document 'vertices/some-key' no longer exists
3345+
});
3346+
```
3347+
33153348
### graphVertexCollection.vertex
33163349
33173350
`async graphVertexCollection.vertex(documentHandle): Object`
@@ -3377,6 +3410,37 @@ collection.save({some: 'data'})
33773410
33783411
The *GraphEdgeCollection API* extends the *Collection API* (see above) with the following methods.
33793412
3413+
#### graphEdgeCollection.remove
3414+
3415+
`async graphEdgeCollection.remove(documentHandle): Object`
3416+
3417+
Deletes the edge with the given *documentHandle* from the collection.
3418+
3419+
**Arguments**
3420+
3421+
* **documentHandle**: `string`
3422+
3423+
The handle of the edge to retrieve. This can be either the `_id` or the `_key` of an edge in the collection, or an edge (i.e. an object with an `_id` or `_key` property).
3424+
3425+
**Examples**
3426+
3427+
```js
3428+
var graph = db.graph('some-graph');
3429+
var collection = graph.edgeCollection('edges');
3430+
3431+
collection.remove('some-key')
3432+
.then(() => {
3433+
// document 'edges/some-key' no longer exists
3434+
});
3435+
3436+
// -- or --
3437+
3438+
collection.remove('edges/some-key')
3439+
.then(() => {
3440+
// document 'edges/some-key' no longer exists
3441+
});
3442+
```
3443+
33803444
### graphEdgeCollection.edge
33813445
33823446
`async graphEdgeCollection.edge(documentHandle): Object`

0 commit comments

Comments
 (0)