Delete documents
ArangoDB's official AQL docs for REMOVE can be found here
Remove document by key
Remove an existing document
remove "foo-bar" IN scratch RETURN OLD
You should see the following results:
[
{
"_key": "foo-bar",
"_id": "scratch/foo-bar",
"_rev": "_gdofeje--A",
"field1": "foo",
"field2": "bar"
}
]Running the query again should return an error
Delete documents in a collection based on filter
Remove all documents where field1 = 'field1-updated'
for doc in scratch
filter doc.field1=='foo'
remove doc in scratchYou should see the following result:
[]
You can confirm that the query worked correctly by running:
for doc in scratch
filter doc.field1 == 'foo'
return docYou should see the following result:
```json
[]
```Help us improveAnything unclear or buggy in this tutorial? Provide Feedback