-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
Inspired from meteor.js technology, it could be a really valuable addition to add two properties to object fields :
- Required boolean : if a required field is left empty, save operation crashes
- Default values : if a field is not set, a default values can be selected
A field with a default value should be required. It would save a lot of dumb code in before and after save method.
Process could be like :
- Object is created
- Save method is called on object
- All fields are checked. For each field :
a. if the object has already a value for the field => OK
b. if the object has no value for the field :
i. if field is not required => OK
ii. if field is required :
- if field has a default value => fill field with default value
- if field has no default value => Error : field cannot be undefined
Maybe the easiest way to do this is to create meta collection aside from actual collection that owns all this required / default value data. But this is where my understanding of Parse Server behind the scenes stops.
What do you think ?
puny-d and joaovqm1
Metadata
Metadata
Assignees
Labels
No labels