delete()
Delete a document.
Description
The delete()
method deletes the collection document or collection
definition document from storage.
Return value
Type | Description |
---|---|
|
The method returns the query string followed by |
Examples
The document exists:
Product("394078621888675904") /* not found */
The document doesn’t exist:
document_not_found
error: Collection `Product` does not contain document with id 392886847463751746.
at *query*:1:13
|
1 | Product.byId("392886847463751746")!.delete()
| ^^^^^^^^^^^^^^^^^^^^^^^
|
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!