core
core copied to clipboard
ModelId - Manipulate data without loading
Model.id allow user to create a reference with a model instance, without loading it.
We could introduce method to manipulate this reference;
const MY_REF = Model.id(ID)
await MY_REF.delete();
// Similar as;
const instance = await Model.query()
.id.is(ID)
.findOne();
await instance.delete();
Add;
- [ ] ModelId.query(): Create a query targeting directly the associate instance
- [ ] ModelId.delete(): Auto delete associate instance (shortcut for ModelId.query().deleteOne())