-
Notifications
You must be signed in to change notification settings - Fork 10
Destroy a record
Anton Demushkin edited this page Aug 4, 2019
·
1 revision
To delete or detach a record you need to get its instance before.
const someTag = await Tag.find(1234);
await someTag.delete();
// or
someTag.detach();Let's call the Model as Model and the instance of that model as record.
Detach the node from the tree by invalidating its left and right values.
record.detach()Delete the node with all its children.
async record.delete(options = {})