Search code examples
databasesdkdefaultbackand

Backand - Add a default value, after object is created


In Backand, after I've created an object and have data for it in the database, I'd like to go back and add a default value for a field I overlooked. In the GUI, there appears to be a field for this: Objects > users (the users object I created), but it's greyed out and I can't figure out how to use it.

The default value field is greyed out...

Any help would be appreciated.


Solution

  • Adding default value is done in the Model. From the UI you can edit the field and provide default value or in the JSON Model you add this tag:

    "defaultValue": 100

    The field object look like this:

    "price": { "type": "float", "defaultValue": 100 }