Open
Description
hi there,
I wonder if there is a way to overwrite the default setter of the schema (I thought I read something like this a while ago).
So, when I have a schema like:
const AppModel = new Schema("app", {
uuid: { type: "string" },
name: { type: "string" }
});
I like to have some validation of the "name" in its setter. Lets say something like:
AppModel = {
setName(value) {
if (value.length >= 3)
this.value = value.toLowerCase();
}
}
I like having the db defition & input validation on one place.
kind regards!
Metadata
Metadata
Assignees
Labels
No labels