deleteAll
The deleteAll
method removes all data from a Database Element.
async function deleteAll(): Promise<void>;
Reference
Overview
You can use deleteAll
to remove all data from the corresponding Database Element.
import { User } from "#elements";
...
await User.deleteAll();
...
Returns
There is no return value.
Examples
delete all data from Database Element
The User Database Element defines two fields, name
and actived
Here's an example of removing all data from the Database Element in a Function Element.
import { User } from "#elements";
export default async function () {
return await User.deleteAll();
}