delete()
Delete a document.
Description
The delete()
method deletes the collection document or collection
definition document from storage.
Return value
Type | Description |
---|---|
|
Returns the query string followed by |
Examples
The document exists:
CoffeeBean.byId("375491155485261889") /* not found */
The document doesn’t exist:
document_not_found
error: Collection `CoffeeBean` does not contain document with id 375491155485261889.
at *query*:1:16
|
1 | CoffeeBean.byId("375491155485261889")!.delete()
| ^^^^^^^^^^^^^^^^^^^^^^^
|
Delete a collection definition document:
Collection.byName("testCollection00") /* not found */
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!