Documents can be deleted using the
Let’s start with the simplest form:
DELETE FROM users;
This command deletes all the documents of the
To delete only a few documents, use the
DELETE FROM users WHERE age > 13;
For every document, the
WHERE clause evaluates any expression that follows, here
age > 13. If the result is truthy, the document gets deleted.
DELETE statement doesn’t return an error if no document matches the
WHERE clause, or if there aren’t any document in the table.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.